pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.11k stars 3.63k forks source link

installation problem #5358

Open jiaruHithub opened 2 years ago

jiaruHithub commented 2 years ago

😡 Describe the installation problem

when I installing the pyg, first pakage is torch-scatter, report the error:

(torch1.6.0) [ggbond@  home]$ python -c "import torch; print(torch.__version__)"
1.6.0
(torch1.6.0) [ggbond@  home]$ python -c "import torch; print(torch.version.cuda)"
10.2
(torch1.6.0) [ggbond@  home]$ python -c "import torch; print(torch.cuda.is_available())"
True
(torch1.6.0) [ggbond@  home]$ pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
Looking in links: https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
Collecting torch-scatter
  Using cached torch_scatter-2.0.9.tar.gz (21 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
  ╰─> [43 lines of output]
      /home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/setuptools/dist.py:774: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        % (opt, underscore_opt)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-37
      creating build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/__init__.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/scatter.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/utils.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      creating build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/__init__.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      running build_ext
      /home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py:277: 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-37
      creating build/temp.linux-x86_64-cpython-37/csrc
      creating build/temp.linux-x86_64-cpython-37/csrc/cpu
      gcc -pthread -B /home/ggbond/.conda/envs/torch1.6.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Icsrc -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/TH -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/THC -I/home/ggbond/.conda/envs/torch1.6.0/include/python3.7m -c csrc/cpu/scatter_cpu.cpp -o build/temp.linux-x86_64-cpython-37/csrc/cpu/scatter_cpu.o -O2 -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -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
Installing collected packages: torch-scatter
  Running setup.py install for torch-scatter ... error
  error: subprocess-exited-with-error

  Γ— Running setup.py install for torch-scatter did not run successfully.
  β”‚ exit code: 1
  ╰─> [45 lines of output]
      /home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/setuptools/dist.py:774: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        % (opt, underscore_opt)
      running install
      /home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-37
      creating build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/__init__.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/scatter.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      copying torch_scatter/utils.py -> build/lib.linux-x86_64-cpython-37/torch_scatter
      creating build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/__init__.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-cpython-37/torch_scatter/composite
      running build_ext
      /home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py:277: 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-37
      creating build/temp.linux-x86_64-cpython-37/csrc
      creating build/temp.linux-x86_64-cpython-37/csrc/cpu
      gcc -pthread -B /home/ggbond/.conda/envs/torch1.6.0/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Icsrc -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/TH -I/home/ggbond/.conda/envs/torch1.6.0/lib/python3.7/site-packages/torch/include/THC -I/home/ggbond/.conda/envs/torch1.6.0/include/python3.7m -c csrc/cpu/scatter_cpu.cpp -o build/temp.linux-x86_64-cpython-37/csrc/cpu/scatter_cpu.o -O2 -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -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: legacy-install-failure

Γ— Encountered error while trying to install package.
╰─> torch-scatter

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

thank you for help!

Environment

rusty1s commented 2 years ago

Try defining versioning for these packages, see here.

pip install torch-scatter==2.0.6 torch-sparse==0.6.9 -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html