PyTorch and torch_scatter were compiled with different CUDA versions on Google Colab despite attempting to specify same version
I'm installing pytorch geometric on Google colab. I've done this lots of times before and had no issues but it has suddenly stopped working. I've not changed my code since it worked. Here is how I install it:
!pip install torch==1.8.1 torchvision torchtext
import torch; print(torch.__version__); print(torch.version.cuda)

!pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html
!pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html
!pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html
!pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html
!pip install torch-geometric

The pytorch version should be 1.8.1+cu102, confirmed by the print statement above. I specify the version when installing with !pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html. However, when I import torch_geometric I get the error:

Detected that PyTorch and torch_scatter were compiled with different CUDA versions. PyTorch has CUDA version 10.2 and torch_scatter has CUDA version 11.1. Please reinstall the torch_scatter that matches your PyTorch install.

Why is torch_scatter not compiling with CUDA version 10.2? Is there a way to force it to compile with this version?

you could try to specify the latest wheel version provided by the link you use: https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html (for November 22nd 2021 it is 2.0.8):
pip install torch-scatter==2.0.8 -f https://data.pyg.org/whl/torch-1.8.1+cu102.html

It looks like the latest torch-scatter version in Google Colab is 2.0.9 which is newer than 2.0.8. Therefore, when you run your command it does not do anything thinking that the latest version is already installed.
