Before formal installation, you need to check the torch version first.
1. Check the torch version
1. win+R, enter cmd
2. Enter python
3. Enter import torch, then torch.__version__, and finally press Enter
You can see that my torch version is 1.10.0
2. Download the appropriate torch_sparse version
1. Open the link
https://pytorch-geometric.com/whl/
2. Select the corresponding torch version
If there is cude, choose the corresponding cuxxx, if not, choose cpu.
3. Download the corresponding torch_sparse version
This should correspond to your own python. Mine is 3.9.7, so it corresponds to cp39. Find it according to this idea, and then download it. I am win, so what I downloaded is torch_sparse-0.6.13-cp39-cp39-win_amd64.whl.
3. Installation
The simplest and most direct way is to copy the file you just downloaded to the folder where your program is located
Then open pycharm and enter pip install.