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 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_XXX version
If we want to install torch_geometric, we must first download it togethertorch_cluster, torch_scatter, torch_sparse, torch_spline_conv. Note that torch_geometric does not need to be downloaded.
First, you need to find the corresponding version. Here you need to match it with your own python. Mine is 3.9.7, so it corresponds to cp39. I am running a Windows system, so I downloaded Win-related files, followed this idea, and then downloaded them.
torch_cluster-1.6.0-cp39-cp39-win_amd64.whl
torch_scatter-2.0.9-cp39-cp39-win_amd64.whl
torch_sparse-0.6.13-cp39-cp39-win_amd64.whl
torch_spline_conv-1.2.1-cp39-cp39-win_amd64.whl
torch_geometric
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.
1、torch_cluster
pip install torch_cluster-1.6.0-cp39-cp39-win_amd64.whl
2、torch_scatter
pip install torch_scatter-2.0.9-cp39-cp39-win_amd64.whl
3、torch_sparse
pip install torch_sparse-0.6.13-cp39-cp39-win_amd64.whl
(The display method here should be Successfully installed torch-sparse-0.6.13, because I have installed it before, so I have the following display)
4、torch_geometric
pip install torch_geometric
4. Complete
If you look at it now, the red wavy line at the beginning is gone.