pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
20.54k stars 3.57k forks source link

Still error after installing dependencies:No module named 'torch_geometric.utils.subgraph' #9344

Open Aminoacid1226 opened 1 month ago

Aminoacid1226 commented 1 month ago

😵 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

rusty1s commented 1 month ago

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 commented 1 month ago

Thank you for your reply, I have solved this problem