Installation problem with PyTorch's Geometric. "torch-scatter" produces an error with exit status 1

5.3k Views Asked by At

Could anyone if used PyTorch geometric before, help me resolve this issue. I'm having trouble installing torch-scatter from PyTorch Geometric to deal with some tabular data for question answering task based on TAPAS model. I presume there is a compile error at source. I tried checking other forums and found no solution for this yet.

Procedure followed to produce the error:

pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

pip3 install torch-scatter

Console output:

ERROR: Command errored out with exit status 1:

I also tried using the python -f flag and specifically tried to pull from the source at:

pip3 install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.1+cpu.html

Following are my PyTorch and CUDA versions with the respective imports and console outputs:

python -c "import torch; print(torch.__version__)"

Output:

1.8.1+cpu

CUDA version:

python -c "import torch; print(torch.version.cuda)"

Output:

None

Python version:

Python 3.7.5
 

Thank you very much for your time and guidance.

3

There are 3 best solutions below

0
On

Solution found: The error is due to wrong/unsupported GCC versions (that's indeed more PyTorch related). I tried installing from binaries which couldn't find compatible version. After some research, I found that Pytorch geometric installation documentation suggests that only PyTorch versions 1.4.0, 1.5.0, 1.6.0, 1.7.0, and 1.8.0 are compatible, but does not explicitly mentions this.

Following solution worked:

Downgrading PyTorch to any of the above versions solved the issue. Make sure that you use the same version of PyTorch and torch-scatter while installation. In my case, 1.8.0

0
On

I also had some issues related to the torch_geometric, and I resolved those issues after some research. Following are the solutions that I have applied:

After installing torch, please install the following libs:

 1. torch-scatter

 2. torch-sparse

 3. torch-cluster

Then install torch-geometric.

You can install the above packages using pip command (pip install ), If it does not work install through HTML link by selecting your specific version.

Command: pip install libname -f link

Example: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0%2Bcpu.html

For my case, I have used the torch 1.12 and install the above packages from the above link.

Thanks

0
On

I had this problem too which is solved by install C++ build tools. You can install it from vs_buildtools.exe that is downloadable here