pytorch_geometric: ModuleNotFoundError: No module named 'torch_geometric'
📚 Installation
While trying to run the following section:
from torch_geometric.data import Data
I got the following error: Traceback (most recent call last): File “<frozen importlib._bootstrap>”, line 971, in _find_and_load File “<frozen importlib._bootstrap>”, line 941, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed ModuleNotFoundError: No module named ‘torch_geometric’
Environment
- OS: windows 10
- Python version: 3.7.9
- PyTorch version: 1.7.0
- CUDA/cuDNN version: 10.2
- GCC version: g++ (MinGW.org GCC-6.3.0-1) 6.3.0
- How did you try to install PyTorch Geometric and its extensions (wheel, source): I’ve created anaconda env with python 3.7.9 and installed the packages using the following:
pytorch installation: conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
pip install torch-scatter==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-sparse==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-cluster==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-spline-conv==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.7.0.html pip install torch-geometric
checking the versions: python -c “import torch; print(torch.version)”
1.7.0
python -c “import torch; print(torch.version.cuda)”
10.2
nvcc --version
nvcc: NVIDIA ® Cuda compiler driver Copyright © 2005-2019 NVIDIA Corporation Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019 Cuda compilation tools, release 10.2, V10.2.89
Checklist
- [ V ] I followed the installation guide.
- [ V ] I cannot find my error message in the FAQ.
- [ V ] I set up CUDA correctly and can compile CUDA code via
nvcc
. - [ X ] I do have multiple CUDA versions on my machine.
Appreciate your help
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (5 by maintainers)
If you want to load an OGB dataset in PyG format, you need to install PyG as well. See here on how to do so in Google Colab. In particular, you need to install the
cu102
wheels on Colab:The problem is not about env, just check this colab notebook,
Colab ogb-getting started example with PygGraphPropPredDataset error
Data Loaders code from ogb homepage.
No, I don’t think this was the problem. I’ve installed everything from scratch and now everything works. Thanks for the help!