rusty1s / pytorch_scatter

PyTorch Extension Library of Optimized Scatter Operations
https://pytorch-scatter.readthedocs.io
MIT License
1.5k stars 178 forks source link

Issue while installing it with pytorch 1.8.0 #408

Open huiyyu opened 5 months ago

huiyyu commented 5 months ago

I created an env with pytorch 1.8.0 and activated that environment. After activating the env, I installed scatter inside the en using the following command: pip install torch-scatter -f https://data.pyg.org/whl/torch-1.8.0+$cu111.html.

This is the error I met:

Looking in links: https://data.pyg.org/whl/torch-1.8.0+.html Collecting torch-scatter Using cached torch_scatter-2.1.2.tar.gz (108 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: torch-scatter Building wheel for torch-scatter (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [52 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-38 creating build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/init.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/scatter.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/testing.py -> build/lib.linux-x86_64-cpython-38/torch_scatter copying torch_scatter/utils.py -> build/lib.linux-x86_64-cpython-38/torch_scatter creating build/lib.linux-x86_64-cpython-38/torch_scatter/composite copying torch_scatter/composite/init.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite running egg_info writing torch_scatter.egg-info/PKG-INFO writing dependency_links to torch_scatter.egg-info/dependency_links.txt writing requirements to torch_scatter.egg-info/requires.txt writing top-level names to torch_scatter.egg-info/top_level.txt reading manifest file 'torch_scatter.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*' found under directory 'test' adding license file 'LICENSE' writing manifest file 'torch_scatter.egg-info/SOURCES.txt' running build_ext /home/huang.huiy/conda_env/test_pytorch_env_v1/lib/python3.8/site-packages/torch/utils/cpp_extension.py:311: UserWarning:

                                 !! WARNING !!

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
  Please use a compiler that is ABI-compatible with GCC 5.0 and above.
  See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

  See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
  for instructions on how to install GCC 5 or higher.
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                                !! WARNING !!

    warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
  building 'torch_scatter._scatter_cpu' extension
  creating build/temp.linux-x86_64-cpython-38
  creating build/temp.linux-x86_64-cpython-38/csrc
  creating build/temp.linux-x86_64-cpython-38/csrc/cpu
  gcc -pthread -B /home/huang.huiy/conda_env/test_pytorch_env_v1/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_PYTHON -Icsrc -I/home/huang.huiy/conda_env/test_pytorch_env_v1/lib/python3.8/site-packages/torch/include -I/home/huang.huiy/conda_env/test_pytorch_env_v1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/huang.huiy/conda_env/test_pytorch_env_v1/lib/python3.8/site-packages/torch/include/TH -I/home/huang.huiy/conda_env/test_pytorch_env_v1/lib/python3.8/site-packages/torch/include/THC -I/home/huang.huiy/conda_env/test_pytorch_env_v1/include/python3.8 -c csrc/cpu/scatter_cpu.cpp -o build/temp.linux-x86_64-cpython-38/csrc/cpu/scatter_cpu.o -O3 -Wno-sign-compare -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  gcc: error: unrecognized command line option ‘-std=c++14’
  error: command '/usr/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torch-scatter Running setup.py clean for torch-scatter Failed to build torch-scatter ERROR: Could not build wheels for torch-scatter, which is required to install pyproject.toml-based projects

Any help would be appreciated a lot!

rusty1s commented 5 months ago

Can you try to install via

pip install torch-scatter --no-index -f https://data.pyg.org/whl/torch-1.8.0+$cu111.html
huiyyu commented 5 months ago

Yes. I tried but it failed with this message:

Looking in links: https://data.pyg.org/whl/torch-1.8.0+.html ERROR: Could not find a version that satisfies the requirement torch-scatter (from versions: none) ERROR: No matching distribution found for torch-scatter

Is there any other way that I can try?

rusty1s commented 5 months ago

Sorry, needs to be

pip install torch-scatter --no-index -f https://data.pyg.org/whl/torch-1.8.0+cu111.html
huiyyu commented 5 months ago

Thanks! It worked.