cannot successfully install "torch-scatter"

username: zhangguanghui1
cooked: <p>I cannot successfully install “torch_scatter”.<br>
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!</p>
<p>The error:<br>
…<br>
cpu/scatter.cpp:1:29: fatal error: torch/extension.h: No such file or directory<br>
compilation terminated.<br>
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1</p>
<p>Failed building wheel for torch-scatter<br>
Running setup.py clean for torch-scatter<br>
Failed to build torch-scatter<br>
Installing collected packages: torch-scatter<br>
Running setup.py install for torch-scatter … error<br>
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize; <strong>file</strong> =’/tmp/pip-build-ijd9s63n/torch-scatter/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( <strong>file</strong> ).read().replace(’\r\n’, ‘\n’), <strong>file</strong> , ‘exec’))” install --record /tmp/pip-4tkx7v_s-record/install-record.txt --single-version-externally-managed --compile:<br>
running install<br>
running build<br>
running build_py<br>
creating build<br>
creating build/lib.linux-x86_64-3.5<br>
creating build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/mul.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/mean.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/sub.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/min.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/std.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/ <strong>init</strong> .py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/max.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/div.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
copying torch_scatter/add.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter<br>
creating build/lib.linux-x86_64-3.5/test<br>
copying test/test_multi_gpu.py -&gt; build/lib.linux-x86_64-3.5/test<br>
copying test/utils.py -&gt; build/lib.linux-x86_64-3.5/test<br>
copying test/test_std.py -&gt; build/lib.linux-x86_64-3.5/test<br>
copying test/ <strong>init</strong> .py -&gt; build/lib.linux-x86_64-3.5/test<br>
copying test/test_forward.py -&gt; build/lib.linux-x86_64-3.5/test<br>
copying test/test_backward.py -&gt; build/lib.linux-x86_64-3.5/test<br>
creating build/lib.linux-x86_64-3.5/torch_scatter/utils<br>
copying torch_scatter/utils/ext.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter/utils<br>
copying torch_scatter/utils/ <strong>init</strong> .py -&gt; build/lib.linux-x86_64-3.5/torch_scatter/utils<br>
copying torch_scatter/utils/gen.py -&gt; build/lib.linux-x86_64-3.5/torch_scatter/utils<br>
running build_ext<br>
building ‘torch_scatter.scatter_cpu’ extension<br>
creating build/temp.linux-x86_64-3.5<br>
creating build/temp.linux-x86_64-3.5/cpu<br>
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<br>
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++<br>
cpu/scatter.cpp:1:29: fatal error: torch/extension.h: No such file or directory<br>
compilation terminated.<br>
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1</p>
<pre><code class="lang-auto">----------------------------------------
</code></pre>
<p>Command “/usr/bin/python3 -u -c “import setuptools, tokenize; <strong>file</strong> =’/tmp/pip-build-ijd9s63n/torch-scatter/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( <strong>file</strong> ).read().replace(’\r\n’, ‘\n’), <strong>file</strong> , ‘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/<br>
You are using pip version 8.1.1, however version 19.1.1 is available.<br>
You should consider upgrading via the ‘pip install --upgrade pip’ command.</p>

username: Lavenderjiang
cooked: <p>Hi Guanghui,</p>
<p>did you end up resolving this issue? I’ve been stuck on it for a while, and found no solution…</p>