python遇到错误:“ImportError: cannot import name ‘NUMPY_MKL’”

错误详情如下:

Traceback (most recent call last):
File “boids.py”, line 14, in
from scipy.spatial.distance import squareform, pdist, cdist
File “C:\Anaconda3\lib\site-packages\scipy\__init__.py”, line 61, in
from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl
ImportError: cannot import name ‘NUMPY_MKL’

原因:

If you look at the line which is causing the error, you’ll see this:

from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl

This line comment states the dependency as numpy+mkl (numpy with Intel Math Kernel Library). This means that you’ve installed the numpy by pip, but the scipy was installed by precompiled archive, which expects numpy+mkl. (出自StackOverflow)

解决办法:

重新安装numpy+mkl的whl文件,从这里下载

结果:验证可行

0 0 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论