下载报错及无法卸载numpy的问题?
ImportError: numpy.core.multiarray failed to import
应该是numpy安装出错了,所以执行pip uninstall numpy,也无法成功卸载了,然后重新pip install numpy发现还是不行,会报错:
Found existing installation: numpy 1.7.1
这个1.7.1应该就是上面说的骚操作的结果。后面尝试了什么pip install -U numpy会报错:
Found existing installation: numpy 1.7.1
ERROR: Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
或者尝试:pip install --ignore-installed numpy,可以正常安装numpy;
但是在import numpy的时候会报错:
还是版本问题,最后孤注一掷的解决办法,找到python包的位置,例如centos是/usr/lib64/python2.7/site-packages/下,虽然前面卸载了numpy,进入文件夹后还是能发现numpy文件夹的出现,然后使用rm -rf numpy删除看到的numpy相关文件,
然后再次重新安装numpy,此时恢复正常了!!!
本文来自博客园,作者:{Mr_胡萝卜须},转载请注明原文链接:https://www.cnblogs.com/Mr-fang/p/16663082.html