Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely unable and clueless to install torch_scatter for use with comfyUI/Webui #9619

Open
jkerman2000 opened this issue Aug 22, 2024 · 4 comments

Comments

@jkerman2000
Copy link

🐛 Describe the bug

I have no idea what to do here, I'm on my knees. Comfyui's 3D pack requires torch_scatter to run, but I get errors everywhere when I try to add it via pip install. Here's the wall of text it spits out:

Collecting torch_scatter
Using cached torch_scatter-2.1.2.tar.gz (108 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
╰─> [39 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-310\torch_scatter
copying torch_scatter_init_.py -> build\lib.win-amd64-cpython-310\torch_scatter
creating build\lib.win-amd64-cpython-310\torch_scatter\composite
copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite
copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite
copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite
copying torch_scatter\composite_init_.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite
running egg_info
writing torch_scatter.egg-info\PKG-INFO
writing dependency_links to torch_scatter.egg-info\dependency_links.txt
writing requirements to torch_scatter.egg-info\requires.txt
writing top-level names to torch_scatter.egg-info\top_level.txt
reading manifest file 'torch_scatter.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'test'
adding license file 'LICENSE'
writing manifest file 'torch_scatter.egg-info\SOURCES.txt'
running build_ext
building 'torch_scatter._scatter_cpu' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\csrc
creating build\temp.win-amd64-cpython-310\Release\csrc\cpu
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWITH_PYTHON -Dtorchscatter_EXPORTS -Icsrc -IC:\Users\dario\miniconda3\lib\site-packages\torch\include -IC:\Users\dario\miniconda3\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\dario\miniconda3\lib\site-packages\torch\include\TH -IC:\Users\dario\miniconda3\lib\site-packages\torch\include\THC -IC:\Users\dario\miniconda3\include -IC:\Users\dario\miniconda3\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" /EHsc /Tpcsrc\cpu\scatter_cpu.cpp /Fobuild\temp.win-amd64-cpython-310\Release\csrc\cpu\scatter_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -O3 -DAT_PARALLEL_OPENMP /openmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17
cl : Command line warning D9002 : ignoring unknown option '-O3'
scatter_cpu.cpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\cstddef(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe' failed with exit code 2
[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
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (torch_scatter)

Versions

'curl' is not recognized as an internal or external command,
operable program or batch file.

@akihironitta
Copy link
Member

What command did you run?

@jkerman2000
Copy link
Author

What command did you run?

pip install torch_scatter

@rachitk
Copy link
Contributor

rachitk commented Aug 23, 2024

Try installing torch-scatter from prebuilt wheels instead. Go to https://data.pyg.org/whl/ and select your PyTorch version + CUDA version (or CPU if not using CUDA). You can then select a torch-scatter wheel that is for Windows and your version of Python.

for example:

https://data.pyg.org/whl/torch-2.0.0%2Bcu117/torch_scatter-2.1.2%2Bpt20cu117-cp310-cp310-win_amd64.whl

would work for PyTorch 2.0.0 compiled with CUDA 11.7, for Python 3.10 on a Windows OS.

You can just run pip install [wheel].

@jkerman2000
Copy link
Author

Yup, that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants