I’m trying to install torch_sparse in my environment with:
pip install torch_sparse
At first the installation could not find cuda.h, but following this topic I’ve set the CUDA_HOME variable to my environment directory. After that I get the error message below (end of message), complaining about not finding nvcc. I’ve searched for my nvcc and its actual address is at the anaconda3 bin dir: /mnt/LINUX_DADOS/anaconda3/bin/nvcc
Can/Should I copy the nvcc bin, or should I set another variable before running pip?
I’ve followed the steps in this video to install nvcc, cudatoolkit and pytorch:
conda install -c nvidia cuda-nvcc
conda install -c anaconda cudatoolkit
conda install pytorch torchvision torchaudio pytorch-cuda -c pytorch -c nvidia
Thanks in advance,
Collecting torch_sparse
Using cached torch_sparse-0.6.18.tar.gz (209 kB)
Preparing metadata (setup.py) … done
Requirement already satisfied: scipy in /mnt/LINUX_DADOS/anaconda3/envs/difusco/lib/python3.12/site-packages (from torch_sparse) (1.13.0)
Requirement already satisfied: numpy<2.3,>=1.22.4 in /mnt/LINUX_DADOS/anaconda3/envs/difusco/lib/python3.12/site-packages (from scipy->torch_sparse) (1.26.4)
Building wheels for collected packages: torch_sparse
Building wheel for torch_sparse (setup.py) … error
error: subprocess-exited-with-error× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [53 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-312
creating build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/index_select.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/spmm.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/cat.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/rw.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/convert.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/coalesce.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/bandwidth.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/tensor.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/storage.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/spspmm.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/spadd.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/typing.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/metis.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/saint.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/transpose.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/matmul.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/add.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/utils.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/mul.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/testing.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/masked_select.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/diag.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/reduce.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/permute.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/eye.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/sample.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/select.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/narrow.py → build/lib.linux-x86_64-cpython-312/torch_sparse
copying torch_sparse/init.py → build/lib.linux-x86_64-cpython-312/torch_sparse
running egg_info
writing torch_sparse.egg-info/PKG-INFO
writing dependency_links to torch_sparse.egg-info/dependency_links.txt
writing requirements to torch_sparse.egg-info/requires.txt
writing top-level names to torch_sparse.egg-info/top_level.txt
reading manifest file ‘torch_sparse.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no previously-included files matching ‘’ found under directory ‘third_party/parallel-hashmap/css’
warning: no previously-included files matching '’ found under directory ‘third_party/parallel-hashmap/html’
warning: no previously-included files matching ‘’ found under directory ‘third_party/parallel-hashmap/tests’
warning: no previously-included files matching '’ found under directory ‘third_party/parallel-hashmap/examples’
warning: no previously-included files matching ‘’ found under directory ‘third_party/parallel-hashmap/benchmark’
warning: no previously-included files matching '’ found under directory ‘test’
warning: no previously-included files matching ‘*’ found under directory ‘benchmark’
adding license file ‘LICENSE’
writing manifest file ‘torch_sparse.egg-info/SOURCES.txt’
running build_ext
error: [Errno 2] No such file or directory: ‘/mnt/LINUX_DADOS/anaconda3/envs/difusco/bin/nvcc’
[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for torch_sparse
Running setup.py clean for torch_sparse
Failed to build torch_sparse
ERROR: Could not build wheels for torch_sparse, which is required to install pyproject.toml-based projects