ModuleNotFoundError: No module named ‘scipy.sparse.linalg.eigen.arpack‘; ‘scipy.sparse.linalg.eigen‘

项目场景:

https://github.com/tkipf/gcn


问题描述

ModuleNotFoundError: No module named ‘scipy.sparse.linalg.eigen.arpack’; ‘scipy.sparse.linalg.eigen’ is not a package

C:\Users\sherlock\AppData\Local\Programs\Python\Python38\python.exe C:/Users/sherlock/source/PyCharm_L/GNN-Test/gcn-master/gcn/train.py
2022-04-13 16:12:00.552533: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-04-13 16:12:00.552774: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "C:/Users/sherlock/source/PyCharm_L/GNN-Test/gcn-master/gcn/train.py", line 7, in 
    from gcn.utils import *
  File "C:\Users\sherlock\source\PyCharm_L\GNN-Test\gcn-master\gcn\utils.py", line 6, in 
    from scipy.sparse.linalg.eigen.arpack import eigsh
ModuleNotFoundError: No module named 'scipy.sparse.linalg.eigen.arpack'; 'scipy.sparse.linalg.eigen' is not a package

原因分析:

scipy更新之后不兼容

from scipy.sparse.linalg.eigen.arpack import eigsh

改为

from scipy.sparse.linalg import eigsh

解决方案:

# 过时了
from scipy.sparse.linalg.eigen.arpack import eigsh
# 改为
from scipy.sparse.linalg import eigsh

你可能感兴趣的:(python,GNN,python)