Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during installation #10

Closed
remarkSD opened this issue Dec 30, 2018 · 4 comments
Closed

Error during installation #10

remarkSD opened this issue Dec 30, 2018 · 4 comments

Comments

@remarkSD
Copy link

remarkSD commented Dec 30, 2018

I am using python 3.6, Pytorch 1.0.

I am getting the following error when installing:

pip install torch-cluster
Collecting torch-cluster
  Using cached https://files.pythonhosted.org/packages/33/b7/05b9ce9afc76f5709efe04d6344fbed09ea217f916f94e63f2fe9659eb62/torch_cluster-1.2.2.tar.gz
Requirement already satisfied: scipy in /home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages (from torch-cluster) (1.1.0)
Building wheels for collected packages: torch-cluster
  Running setup.py bdist_wheel for torch-cluster ... error
  Complete output from command /home/airscan-razer04/miniconda3/envs/pytorch/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_id9r1qr/torch-cluster/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ij35ca3y --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/nearest.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/fps.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/knn.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/graclus.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/grid.py -> build/lib.linux-x86_64-3.6/torch_cluster
  copying torch_cluster/radius.py -> build/lib.linux-x86_64-3.6/torch_cluster
  creating build/lib.linux-x86_64-3.6/test
  copying test/test_radius.py -> build/lib.linux-x86_64-3.6/test
  copying test/__init__.py -> build/lib.linux-x86_64-3.6/test
  copying test/test_fps.py -> build/lib.linux-x86_64-3.6/test
  copying test/test_knn.py -> build/lib.linux-x86_64-3.6/test
  copying test/test_nearest.py -> build/lib.linux-x86_64-3.6/test
  copying test/test_graclus.py -> build/lib.linux-x86_64-3.6/test
  copying test/utils.py -> build/lib.linux-x86_64-3.6/test
  copying test/test_grid.py -> build/lib.linux-x86_64-3.6/test
  creating build/lib.linux-x86_64-3.6/torch_cluster/_ext
  copying torch_cluster/_ext/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster/_ext
  creating build/lib.linux-x86_64-3.6/torch_cluster/_ext/ffi
  copying torch_cluster/_ext/ffi/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster/_ext/ffi
  running build_ext
  building 'graclus_cpu' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/cpu
  gcc -pthread -B /home/airscan-razer04/miniconda3/envs/pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include/TH -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include/THC -I/home/airscan-razer04/miniconda3/envs/pytorch/include/python3.6m -c cpu/graclus.cpp -o build/temp.linux-x86_64-3.6/cpu/graclus.o -DTORCH_EXTENSION_NAME=graclus_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  cpu/graclus.cpp:1:29: fatal error: torch/extension.h: No such file or directory
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for torch-cluster
  Running setup.py clean for torch-cluster
Failed to build torch-cluster
Installing collected packages: torch-cluster
  Running setup.py install for torch-cluster ... error
    Complete output from command /home/airscan-razer04/miniconda3/envs/pytorch/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_id9r1qr/torch-cluster/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-esqv00gn/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/nearest.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/fps.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/knn.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/graclus.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/grid.py -> build/lib.linux-x86_64-3.6/torch_cluster
    copying torch_cluster/radius.py -> build/lib.linux-x86_64-3.6/torch_cluster
    creating build/lib.linux-x86_64-3.6/test
    copying test/test_radius.py -> build/lib.linux-x86_64-3.6/test
    copying test/__init__.py -> build/lib.linux-x86_64-3.6/test
    copying test/test_fps.py -> build/lib.linux-x86_64-3.6/test
    copying test/test_knn.py -> build/lib.linux-x86_64-3.6/test
    copying test/test_nearest.py -> build/lib.linux-x86_64-3.6/test
    copying test/test_graclus.py -> build/lib.linux-x86_64-3.6/test
    copying test/utils.py -> build/lib.linux-x86_64-3.6/test
    copying test/test_grid.py -> build/lib.linux-x86_64-3.6/test
    creating build/lib.linux-x86_64-3.6/torch_cluster/_ext
    copying torch_cluster/_ext/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster/_ext
    creating build/lib.linux-x86_64-3.6/torch_cluster/_ext/ffi
    copying torch_cluster/_ext/ffi/__init__.py -> build/lib.linux-x86_64-3.6/torch_cluster/_ext/ffi
    running build_ext
    building 'graclus_cpu' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/cpu
    gcc -pthread -B /home/airscan-razer04/miniconda3/envs/pytorch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include/TH -I/home/airscan-razer04/miniconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/include/THC -I/home/airscan-razer04/miniconda3/envs/pytorch/include/python3.6m -c cpu/graclus.cpp -o build/temp.linux-x86_64-3.6/cpu/graclus.o -DTORCH_EXTENSION_NAME=graclus_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    cpu/graclus.cpp:1:29: fatal error: torch/extension.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/airscan-razer04/miniconda3/envs/pytorch/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_id9r1qr/torch-cluster/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-esqv00gn/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-_id9r1qr/torch-cluster/

I've already set the cuda/bin and cuda/include in PATH and CPATH.
I'm still trying to figure out if I'm just missing something.
Would appreciate your help on this.

Thanks.

Edit: Apparently, I wasn't using pytorch 1.0. Installation is good after updating pytorch to 1.0.

@rusty1s
Copy link
Owner

rusty1s commented Dec 30, 2018

Are you sure you are on PyTorch 1.0.0? It seems that it can not find the torch/extension header, which was introduced in 1.0.0. You need to either upgrade PyTorch or replace the torch/extension.h calls with torch/torch.h.

@remarkSD
Copy link
Author

Are you sure you are on PyTorch 1.0.0? It seems that it can not find the torch/extension header, which was introduced in 1.0.0. You need to either upgrade PyTorch or replace the torch/extension.h calls with torch/torch.h.

You're right. Apparently I have been using PyTorch 0.4.1 and torchvision 0.2.1. I didn't notice that my pytorch installation got interrupted so it didn't get updated. I'll reply here again if it works.

@remarkSD
Copy link
Author

The pytorch version was the problem. Successfully installed it after updating pytorch to 1.0.
Thanks!

@xuChenSJTU
Copy link

However, it seems that this problem still exists with pytorch 1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants