# cannot successfully install "torch-scatter"

**URL:** <https://discuss.pytorch.org/t/cannot-successfully-install-torch-scatter/44701>\
**Category:** Uncategorized\
**Created:** [May 8, 2019, 9:07am UTC](https://discuss.pytorch.org/t/cannot-successfully-install-torch-scatter/44701 "2019-05-08T09:07:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangguanghui1](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/z/41988e/32.png) [@zhangguanghui1](https://discuss.pytorch.org/u/zhangguanghui1)\
**Post date:** [May 8, 2019, 9:07am UTC](https://discuss.pytorch.org/t/cannot-successfully-install-torch-scatter/44701/1 "2019-05-08T09:07:04Z")

</div>

I cannot successfully install “torch\_scatter”.  
When I run the command line : pip3 install torch\_scatter, an error always occurs, just like below. I tried to solve the problem, but I don’t find the correct method. Could you help me? Thanks a lot!

The error:  
…  
cpu/scatter.cpp:1:29: fatal error: torch/extension.h: No such file or directory  
compilation terminated.  
error: command ‘x86\_64-linux-gnu-gcc’ failed with exit status 1

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  
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize; **file** =’/tmp/pip-build-ijd9s63n/torch-scatter/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-4tkx7v\_s-record/install-record.txt --single-version-externally-managed --compile:  
running install  
running build  
running build\_py  
creating build  
creating build/lib.linux-x86\_64-3.5  
creating build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/mul.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/mean.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/sub.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/min.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/std.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/ **init**.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/max.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/div.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
copying torch\_scatter/add.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter  
creating build/lib.linux-x86\_64-3.5/test  
copying test/test\_multi\_gpu.py -\> build/lib.linux-x86\_64-3.5/test  
copying test/utils.py -\> build/lib.linux-x86\_64-3.5/test  
copying test/test\_std.py -\> build/lib.linux-x86\_64-3.5/test  
copying test/ **init**.py -\> build/lib.linux-x86\_64-3.5/test  
copying test/test\_forward.py -\> build/lib.linux-x86\_64-3.5/test  
copying test/test\_backward.py -\> build/lib.linux-x86\_64-3.5/test  
creating build/lib.linux-x86\_64-3.5/torch\_scatter/utils  
copying torch\_scatter/utils/ext.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter/utils  
copying torch\_scatter/utils/ **init**.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter/utils  
copying torch\_scatter/utils/gen.py -\> build/lib.linux-x86\_64-3.5/torch\_scatter/utils  
running build\_ext  
building ‘torch\_scatter.scatter\_cpu’ extension  
creating build/temp.linux-x86\_64-3.5  
creating build/temp.linux-x86\_64-3.5/cpu  
x86\_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D\_FORTIFY\_SOURCE=2 -fPIC -I/home/zgh/.local/lib/python3.5/site-packages/torch/lib/include -I/home/zgh/.local/lib/python3.5/site-packages/torch/lib/include/TH -I/home/zgh/.local/lib/python3.5/site-packages/torch/lib/include/THC -I/usr/include/python3.5m -c cpu/scatter.cpp -o build/temp.linux-x86\_64-3.5/cpu/scatter.o -Wno-unused-variable -DTORCH\_EXTENSION\_NAME=scatter\_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/scatter.cpp:1:29: fatal error: torch/extension.h: No such file or directory  
compilation terminated.  
error: command ‘x86\_64-linux-gnu-gcc’ failed with exit status 1

```auto
----------------------------------------

```

Command “/usr/bin/python3 -u -c “import setuptools, tokenize; **file** =’/tmp/pip-build-ijd9s63n/torch-scatter/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-4tkx7v\_s-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-build-ijd9s63n/torch-scatter/  
You are using pip version 8.1.1, however version 19.1.1 is available.  
You should consider upgrading via the ‘pip install --upgrade pip’ command.

---

<div class="post-metadata">

**Author:** ![Lavenderjiang](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Lavenderjiang](https://discuss.pytorch.org/u/Lavenderjiang)\
**Post date:** [July 14, 2019, 10:15pm UTC](https://discuss.pytorch.org/t/cannot-successfully-install-torch-scatter/44701/2 "2019-07-14T22:15:20Z")

</div>

Hi Guanghui,

did you end up resolving this issue? I’ve been stuck on it for a while, and found no solution…
