在编程的时候,遇到了如下报错;
ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in [‘D:\Anaconda3\envs\tensorflow\lib\site-packages\numpy’]. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.
错误原因是安装了两个numpy,这两个numpy版本冲突。
解决办法也很简单,全删除了重装一遍即可。操作如下:
1、删除原有numpy
在命令行输入
pip uninstall numpy
如图所示,因为你版本冲突,所以你至少要输入两遍,直到出现黄字警告(最下面红框),告诉你已经全都卸载完了。
从上面两个红框来看,我这里确实存在两个版本的numpy
2、再重新安装numpy
pip install numpy
如图所示,变安装成功了,问题得以解决。