ModuleNotFoundError: No module named 'torch_geometric'
See original GitHub issueš 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
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:No, I donāt think this was the problem. Iāve installed everything from scratch and now everything works. Thanks for the help!