question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rusty1scommented, Jul 11, 2021

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:

!pip install ogb
!pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
1reaction
Omri-Lcommented, Nov 15, 2020

No, I donā€™t think this was the problem. Iā€™ve installed everything from scratch and now everything works. Thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation ā€” pytorch_geometric documentation
e.g., No module named 'torch_*.*_cuda' , or execution simply crashes with Segmentation fault (core dumped) . We collected a lot of common installationĀ ......
Read more >
ModuleNotFoundError: No module named 'torch-geometric'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'torch-geometric' How to remove the Mo.
Read more >
No module named 'torch_geometric'č§£å†³åŠžę³• - CSDN博客
ModuleNotFoundError : No module named 'torch_geometric'å¦‚ä½•č§£å†³ļ¼ˆå·²č§£å†³ļ¼‰ Ā· ModuleNotFoundError: No module named 'torch_geometric'.
Read more >
torch-geometric - PyPI
Easy-to-use and unified API: All it takes is 10-20 lines of code to get ... and is customizable by registering new modules to...
Read more >
PyTorch Geometric CUDA installation issues on Google Colab
!pip install torch-geometric \ torch-sparse==latest+cu101 ... This is the latest code-command,that I've used on co-lab for installingĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found