我正在尝试使用几个模块运行一个过去有效的 python 脚本。一些谷歌搜索建议循环依赖,但是这仅与导入相互依赖的模块的两个文件相关。
似乎归结为scalarmath
找不到,但我不知道为什么。我的代码只是用于计算的简单函数定义,然后调用这些函数(全部在一个文件中)。
我的 IDE 的输出是:
C:\Users\sg15\AppData\Local\Continuum\Anaconda2\python.exe "P:/Solid State QT/NSMM/simulations/InteractionsOfTLF.py"
Traceback (most recent call last):
File "P:/Solid State QT/NSMM/simulations/InteractionsOfTLF.py", line 13, in <module>
import matplotlib.pyplot as plt
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\matplotlib\__init__.py", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\matplotlib\cbook.py", line 33, in <module>
import numpy as np
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\__init__.py", line 185, in <module>
from . import add_newdocs
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\sg15\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\core\__init__.py", line 20, in <module>
from . import scalarmath
ImportError: cannot import name scalarmath
Process finished with exit code 1