python - 导入错误 : cannot import name NUMPY_MKL

标签 python windows python-2.7 numpy scipy

我正在尝试运行以下简单代码

import scipy
scipy.test()

但我收到以下错误

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 586, in runfile
    execfile(filename, namespace)
  File "C:/Users/Mustafa/Documents/My Python Code/SpectralGraphAnalysis/main.py", line 8, in <module>
    import scipy
  File "C:\Python27\lib\site-packages\scipy\__init__.py", line 61, in <module>
    from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl
ImportError: cannot import name NUMPY_MKL

我在 windows 10 下使用 python 2.7。

我已经安装了 scipy 但这似乎并没有解决问题

感谢任何帮助。

最佳答案

如果您查看导致错误的行,您会看到:

from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl

此行注释将依赖关系声明为 numpy+mkl(numpyIntel Math Kernel Library )。这意味着你已经通过 pip 安装了 numpy,但是 scipy 是通过预编译存档安装的,它需要 numpy+mkl .

这个问题可以通过从here的whl文件中安装numpy+mkl来轻松解决.

关于python - 导入错误 : cannot import name NUMPY_MKL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37267399/

相关文章:

windows - 在 Windows 上运行 Kafka

python - 根据具有特殊要求的另一个数组对数组进行排序

python-2.7 - 在 Windows 8 上安装 Python 2.7

python - 从文件中读取一组元组编号

python - 为 Visual Studio Code 安装 Python 包

c++ - 网络和消息

.net - WPF 窗口位置属性 Left、Top、Height 和 Width 是否实际上是双倍的?

python - Python 代码不会样式化

python - 使用 Clock.schedule_interval 每秒更新显示的变量

python - 问题: "argument of type ' float' is not iterable"when iterate rows in Pandas