首先确保pytorch、pyg、cuda的版本对应。

其次,所有步骤的安装,都是用pip。不要pip跟conda混用!!

比如,这里是PyTorch 2.0.1、CUDA11.7,

PyTorch:

pip3 install torch torchvision torchaudio

PyG:

pip3 install torch torchvision torchaudio
pip install torch_geometric
# Optional dependencies:
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu117.html

有可能就可以了。

Installation — pytorch_geometric documentation

Start Locally | PyTorch