Python numpy Import Error Something is wrong with the numpy installation. an older

错误信息描述

症状一

ImportError: Something is wrong with the numpy installation.

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没有卸载掉,两版numpy导致出现冲突。

症状二

一般这种情况下还会伴随有另一个报错:

UserWarning: loaded more than 1 DLL from .libs
  • 进到信息中指定的.libs文件夹中会发现,确实是多了一个DLL文件,注意,这两个文件有一个你有权限删除,但是另一个你不能删除,因为python正在占用。

报错信息more

在前两个症状下进行下一步检测。
如果在未采取措施时,您卸载python再重新安装,在python的语句中import numpy。您会看到这样的信息:(不想看的主儿往后翻,朕有翻译的)

症状三

>>> import numpy
Traceback (most recent call last):
  File "D:\Python3.5.2\lib\site-packages\numpy\core\__init__.py", line 40, in <module>
    from . import multiarray
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python3.5.2\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "D:\Python3.5.2\lib\site-packages\numpy\core\__init__.py", line 71, in <module>
    raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using D:\Python3.5.2\python.exe),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

翻译一下就是,“我给你3条路,第二条路说明你的numpy库破损,想知道怎么办就往后看。”。

解决方案

如报错信息所说

  • 先卸载numpy: pip uninstall numpy
  • 再卸载numpy,直到卸载到提示信息显示,此时完全已经没有numpy了为止
  • 下载numpy:pip install numpy
  • 此时应该可用;
    若不可用,查看python安装目录下的libs文件夹,删除掉其中的另一个dll文件,应该可用。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值