When I type pip install torch-scatter in the cmd, it shows the following error 'cl.exe' failed with 0x000007b code.
Collecting torch-scatter
Using cached https://files.pythonhosted.org/packages/d4/83/67eeea00c2db1959e2ff95d8680dbd756977bfab254bda8658f09dc3bc11/torch_scatter-1.1.2.tar.gz
Building wheels for collected packages: torch-scatter
Building wheel for torch-scatter (setup.py) ... error
Complete output from command d:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-install-fcm_sykj\\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 C:\Users\xxx\AppData\Local\Temp\pip-wheel-f40r_y33 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\test
copying test\test_backward.py -> build\lib.win-amd64-3.6\test
copying test\test_forward.py -> build\lib.win-amd64-3.6\test
copying test\test_multi_gpu.py -> build\lib.win-amd64-3.6\test
copying test\test_std.py -> build\lib.win-amd64-3.6\test
copying test\utils.py -> build\lib.win-amd64-3.6\test
copying test\__init__.py -> build\lib.win-amd64-3.6\test
creating build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\add.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\div.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\max.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\mean.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\min.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\mul.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\std.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\sub.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\__init__.py -> build\lib.win-amd64-3.6\torch_scatter
creating build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\ext.py -> build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\gen.py -> build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\__init__.py -> build\lib.win-amd64-3.6\torch_scatter\utils
running build_ext
d:\python36\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for cl: Command 'cl' returned non-zero exit status 3221225595.
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'torch_scatter.scatter_cpu' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\cpu
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\python36\lib\site-packages\torch\lib\include -Id:\python36\lib\site-packages\torch\lib\include\torch\csrc\api\include -Id:\python36\lib\site-packages\torch\lib\include\TH -Id:\python36\lib\site-packages\torch\lib\include\THC -Id:\python36\include -Id:\python36\include /EHsc /Tpcpu/scatter.cpp /Fobuild\temp.win-amd64-3.6\Release\cpu/scatter.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
Failed building wheel for torch-scatter
Running setup.py clean for torch-scatter
Failed to build torch-scatter
First, I think it is a problem about environment variable. But when I add D:\Microsoft Visual Studio 14.0\VC\bin to the PATH in order to use cl.exe, it still failed to install torch-scatter.
I am not a C/C++ coder. Hope can get some useful information here.
Hi, what is the error message after you add cl.exe to the PATH?
Thank you for your quick reply. When I remove D:\Microsoft Visual Studio 14.0\VC\bin from PATH and type pip install torch-scatter in the cmd prompt, it opens a new dialog telling me that it cannot excute the code because it cannot find the mspdb140.dll file. After I close the dialog , the original cmd prompt shows the following output.
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 d:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-install-pz5b47kj\\torch-scatter\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\xxx\AppData\Local\Temp\pip-record-0czsx4eo\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\test
copying test\test_backward.py -> build\lib.win-amd64-3.6\test
copying test\test_forward.py -> build\lib.win-amd64-3.6\test
copying test\test_multi_gpu.py -> build\lib.win-amd64-3.6\test
copying test\test_std.py -> build\lib.win-amd64-3.6\test
copying test\utils.py -> build\lib.win-amd64-3.6\test
copying test\__init__.py -> build\lib.win-amd64-3.6\test
creating build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\add.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\div.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\max.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\mean.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\min.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\mul.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\std.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\sub.py -> build\lib.win-amd64-3.6\torch_scatter
copying torch_scatter\__init__.py -> build\lib.win-amd64-3.6\torch_scatter
creating build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\ext.py -> build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\gen.py -> build\lib.win-amd64-3.6\torch_scatter\utils
copying torch_scatter\utils\__init__.py -> build\lib.win-amd64-3.6\torch_scatter\utils
running build_ext
d:\python36\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for cl: Command 'cl' returned non-zero exit status 3221225781.
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'torch_scatter.scatter_cpu' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\cpu
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\python36\lib\site-packages\torch\lib\include -Id:\python36\lib\site-packages\torch\lib\include\torch\csrc\api\include -Id:\python36\lib\site-packages\torch\lib\include\TH -Id:\python36\lib\site-packages\torch\lib\include\THC -Id:\python36\include -Id:\python36\include /EHsc /Tpcpu/scatter.cpp /Fobuild\temp.win-amd64-3.6\Release\cpu/scatter.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0
error: command 'cl.exe' failed: No such file or directory
After I add it to PATH, the output is what I show in the last comment (https://github.com/rusty1s/pytorch_geometric/issues/226#issue-435398041).
So it seems it still can not find your compiler. Please verify that cl.exe is executable from the command line.
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
As the error suggest, try downgrading your GCC, e.g., to version 5.4.0.
You can type "pip install torch-scatter==1.1.2" in cmd to install the package of torch-scatter.
I also have a problem with "ERROR: failed building wheel for torch-scatter", the message is like this:
ERROR: Complete output from command 'c:\users\wxd\anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\Users\wxd\AppData\Local\Temp\pip-install-hrj8b7ua\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 'C:\Users\wxd\AppData\Local\Temp\pip-wheel-o3ees3c9' --python-tag cp35:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\test
copying test\test_backward.py -> build\lib.win-amd64-3.5\test
copying test\test_forward.py -> build\lib.win-amd64-3.5\test
copying test\test_max_min.py -> build\lib.win-amd64-3.5\test
copying test\test_multi_gpu.py -> build\lib.win-amd64-3.5\test
copying test\test_std.py -> build\lib.win-amd64-3.5\test
copying test\utils.py -> build\lib.win-amd64-3.5\test
copying test__init__.py -> build\lib.win-amd64-3.5\test
creating build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\add.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\div.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\max.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\mean.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\min.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\mul.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\std.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter\sub.py -> build\lib.win-amd64-3.5\torch_scatter
copying torch_scatter__init__.py -> build\lib.win-amd64-3.5\torch_scatter
creating build\lib.win-amd64-3.5\torch_scatter\utils
copying torch_scatter\utils\ext.py -> build\lib.win-amd64-3.5\torch_scatter\utils
copying torch_scatter\utils\gen.py -> build\lib.win-amd64-3.5\torch_scatter\utils
copying torch_scatter\utils__init__.py -> build\lib.win-amd64-3.5\torch_scatter\utils
running build_ext
c:\users\wxd\anaconda3\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for g++: Command 'g++' returned non-zero exit status 1
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'torch_scatter.scatter_cpu' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\cpu
other error information:
c:\users\wxd\anaconda3\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for g++: Command 'g++' returned non-zero exit status 1
c:\users\wxd\anaconda3\lib\site-packages\torch\include/torch/csrc/jit/ir.h:1077:20: error: function 'torch::jit::Value* torch::jit::Graph::insertGetAttr(torch::jit::Value*, const string&)' definition is marked dllimport
Maybe there is some trouble with my g++?
platform information:
OS:windows 10
python version: python 3.5
torch verison: pytorch 1.1
cuda version: cuda 9.0
gcc version: gcc 5.3.0
relevant information: I use Anaconda
I will be appeciate if you can help me
This could indeed be the problem. It may help to see if gcc 5.4.0 fixes your problems.
Edit: I see that you are on Windows. The MSVC compiler should work just fine there.
This could indeed be the problem. It may help to see if gcc 5.4.0 fixes your problems.
Edit: I see that you are on Windows. The MSVC compiler should work just fine there.
OK,I will try using GCC 5.4.0 on my Anaconda, thank U~
I change OS to ubuntu16.04 bacause anaconda does not have gcc 5.4.0 for win...Installation is OK, but when I run my code, there is some other problems
in the file .../torch_scatter/utils/ext.py and the code is import torch_scatter.scatter_cuda, and there is an error
:Import error ,scatter_cuda.cpython-37m-x86_64-linux-gnu.so:undined symbol: __cudaPopCallConfiguration
Seems related to point 7 in the FAQ.
emmmmm, I try the command, but the results are same and both of them show cuda 9.0.176, :(
Thanks for your help~
Please uninstall torch-scatter, reinstall it and show me the installation log. There must have been an error there.
Created temporary directory: /tmp/pip-ephem-wheel-cache-0x7o1yj_
Created temporary directory: /tmp/pip-req-tracker-756yuiai
Created requirements tracker '/tmp/pip-req-tracker-756yuiai'
Created temporary directory: /tmp/pip-install-8z4jmdcj
Collecting torch-scatter
1 location(s) to search for versions of torch-scatter:
Successfully installed torch-scatter-1.3.1
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-756yuiai'
1 location(s) to search for versions of pip:
the rest information is all links , so I don't paste here
Looks good to me, so I am not really sure what‘s the cause of this issue :( I guess running the test suite of torch-scatter fails?
Most helpful comment
You can type "pip install torch-scatter==1.1.2" in cmd to install the package of torch-scatter.