ImportError: numpy.core.multiarray failed to import 错误分析

ImportError: numpy.core.multiarray failed to import错误分析

  • 造成该错误的原因是numpy或者matplotlib等依赖与python的版本不匹配

网上的解决方法

网上的解决方式大部分都是让更新numpy或者matplotlib等依赖,如:
在这里插入图片描述在这里插入图片描述在这里插入图片描述
网上的方法基本都是让更新numpy,但是这是在python是最新版本的前提下将numpy更新到最新版本,但是我用的是python3.6,所以上述方法仍然无效。因此需要安装对应python3.6版本的numpy和matplotlib等依赖。

运行:

pip install -U numpy==1.13.3
pip install -U matplotlib==2.0.2

测试

测试是否解决上述问题
在终端输入python或者python3

>>>import torch
>>>import matplotlib.pyplot as plt

如果不报错,说明问题解决

猜你喜欢

转载自blog.csdn.net/gaoqing_dream163/article/details/109736856