question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to build wheel for torch-scatter: ERROR: Command errored out with exit status 1:

See original GitHub issue

📚 Installation

Environment

  • OS: Ubuntu 18.04
  • Python version: 3.7.7
  • PyTorch version: 1.5.1
  • CUDA/cuDNN version: 10.1
  • GCC version: 7.5.0
  • How did you try to install PyTorch Geometric and its extensions (wheel, source): source
  • Any other relevant information: Graphic Card-GTX 1060, Driver version-440

Checklist

  • [ ~ ] I followed the installation guide.
  • [ ~ ] I cannot find my error message in the FAQ.
  • [ ~ ] I set up CUDA correctly and can compile CUDA code via nvcc.
  • [ ~ ] I do have multiple CUDA versions on my machine.

Additional context

Hi! I’m trying to install PyTorch Geometric on my Ubuntu 18.04 server. However, when I install it through the official guidance, this error happens. I cannot find it in the frequency Q&A. Could you please help me with this? Thank you so much in advance.


Further Details:

To avoid possible problems, I do these preparation works before I installed:

  • My CUDA version, cuDNN version and PyTorch version are all matched. (10.1)
  • No multiple CUDA in my system. Only CUDA 10.1 is installed. (As well as matched cuDNN)
  • I add all the path, just follow the instructions.
  • nvcc is accessible from the terminal.

However, when I start with pip install torch-scatter, error happens.

Here are the details of my errors:

~/anaconda3/envs/pytorch101$ pip install torch-scatter
Collecting torch-scatter
  Downloading torch_scatter-2.0.5.tar.gz (20 kB)
Building wheels for collected packages: torch-scatter

  Building wheel for torch-scatter (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: /home/zihan/anaconda3/envs/pytorch101/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jeo_88fj/torch-scatter/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jeo_88fj/torch-scatter/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-wmjvsyru
       cwd: /tmp/pip-install-jeo_88fj/torch-scatter/
  Complete output (108 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/utils.py -> build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/__init__.py -> build/lib.linux-x86_64-3.7/torch_scatter
  copying torch_scatter/scatter.py -> build/lib.linux-x86_64-3.7/torch_scatter
  creating build/lib.linux-x86_64-3.7/torch_scatter/composite
  copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-3.7/torch_scatter/composite
  copying torch_scatter/composite/__init__.py -> build/lib.linux-x86_64-3.7/torch_scatter/composite
  copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-3.7/torch_scatter/composite
  copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-3.7/torch_scatter/composite
  running build_ext
  building 'torch_scatter._scatter' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/tmp
  creating build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj
  creating build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter
  creating build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc
  creating build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc/cpu
  creating build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc/cuda
  gcc -pthread -B /home/zihan/anaconda3/envs/pytorch101/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/tmp/pip-install-jeo_88fj/torch-scatter/csrc -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/TH -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zihan/anaconda3/envs/pytorch101/include/python3.7m -c /tmp/pip-install-jeo_88fj/torch-scatter/csrc/scatter.cpp -o build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc/scatter.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  gcc -pthread -B /home/zihan/anaconda3/envs/pytorch101/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/tmp/pip-install-jeo_88fj/torch-scatter/csrc -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/TH -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zihan/anaconda3/envs/pytorch101/include/python3.7m -c /tmp/pip-install-jeo_88fj/torch-scatter/csrc/cpu/scatter_cpu.cpp -o build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc/cpu/scatter_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/tmp/pip-install-jeo_88fj/torch-scatter/csrc -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/TH -I/home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zihan/anaconda3/envs/pytorch101/include/python3.7m -c /tmp/pip-install-jeo_88fj/torch-scatter/csrc/cuda/scatter_cuda.cu -o build/temp.linux-x86_64-3.7/tmp/pip-install-jeo_88fj/torch-scatter/csrc/cuda/scatter_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -arch=sm_35 --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(14): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(18): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(23): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(100): warning: attribute "__visibility__" does not apply here
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(115): warning: attribute "__visibility__" does not apply here
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/enum.h(187): warning: statement is unreachable
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/enum.h(187): warning: statement is unreachable
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(14): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(15): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(18): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(19): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(23): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/functional/padding.h(24): warning: integer conversion resulted in a change of sign
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(100): warning: attribute "__visibility__" does not apply here
  
  /home/zihan/anaconda3/envs/pytorch101/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/profiler.h(115): warning: attribute "__visibility__" does not apply here
  
  /usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
  /usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
  /usr/include/c++/7/bits/basic_string.h:5042:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
  /usr/include/c++/7/bits/basic_string.h:5063:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
  /usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
  /usr/include/c++/7/bits/basic_string.h:6688:95:   required from here
  /usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
         __p->_M_set_sharable();
         ~~~~~~~~~^~
  /usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
  /usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
  /usr/include/c++/7/bits/basic_string.h:5042:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
  /usr/include/c++/7/bits/basic_string.h:5063:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
  /usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
  /usr/include/c++/7/bits/basic_string.h:6693:95:   required from here
  /usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
  error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for torch-scatter

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jun 7, 2021

Since PyG is quite “old” already, we supported all PyTorch versions >= 0.4 at some point in time (with torch-geometric, torch-scatter, … having specific version requirements). I will curate a list of version dependencies at some point in time 😃

1reaction
ZihanChen1995commented, Jun 5, 2021

Mind sharing how you solved the problem? @ZihanChen1995 Thank you.

Hi, at that time, I just downgraded the PyTorch version and it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation problem with PyTorch's Geometric. "torch-scatter ...
I'm having trouble installing torch-scatter from PyTorch Geometric to deal with some tabular data for question answering task based on TAPAS ...
Read more >
error: failed building wheel for torch-sparse - QBExpress
1 from torch.autograd import Function ERROR: Failed building wheel ... ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c ...
Read more >
Installation — pytorch_geometric documentation
pip install pyg-lib torch-scatter torch-sparse -f ... error: command '/usr/bin/nvcc' failed with exit status 2 : Ensure that at least CUDA >= 8...
Read more >
Want to install : torch-sparse, getting this error - PyTorch Forums
ERROR : Command errored out with exit status 1: command: ... ERROR: Failed building wheel for torch-sparse ERROR: Command errored out with ...
Read more >
Unable to install torch-scatter and other packages - Jetson Nano
Hi, I am attempting to create a dockerized Jupyter notebook container based on the DLI image with my own additions of using PyTorch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found