Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still error after installing dependencies锛歂o module named 'torch_geometric.utils.subgraph' #9344

Open
Aminoacid1226 opened this issue May 22, 2024 · 2 comments

Comments

@Aminoacid1226
Copy link

馃樀 Describe the installation problem

I installed four additional dependencies following the tutorial:

**Scatter - 2.1.2 + pt23cu118 - cp38 - cp38 - linux_x86_64. WHL

Torch_sparse 0.6.18 + pt23cu118 cp38 - cp38 - linux_x86_64. WHL

Torch_cluster 1.6.3 + pt23cu118 cp38 - cp38 - linux_x86_64. WHL

Torch_spline_conv 1.2.2 + pt23cu118 cp38 - cp38 - linux_x86_64. WHL**

It is then installed using pip install torch_geometric.

But when I run the file it still says: No module named 'torch_geometric.utils.subgraph'

Excuse me, what's going on here?

**I looked at the file in torch_geometry.utils. There was a file called _subgraph.py.

Why is there still an error?**

Environment

  • PyG version:2.1.0
  • PyTorch version: 2.3
  • OS: Linux
  • Python version: 3.8
  • CUDA/cuDNN version:11.8
  • How you installed PyTorch and PyG (conda, pip, source): pip
  • Any other relevant information (e.g., version of torch-scatter):
    scatter-2.1.2+pt23cu118-cp38-cp38-linux_x86_64
    sparse-0.6.18+pt23cu118-cp38-cp38-linux_x86_64
    cluster-1.6.3+pt23cu118-cp38-cp38-linux_x86_64
    spline_conv-1.2.2+pt23cu118-cp38-cp38-linux_x86_64
@rusty1s
Copy link
Member

rusty1s commented May 27, 2024

You can either do

from torch_geometric.utils import subgraph

or do

import torch_geometric.utils._subgraph

The file was re-named from subgraph to _subgraph.

@Aminoacid1226
Copy link
Author

Thank you for your reply, I have solved this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants