我已经在 Ubuntu 16.04 LTS 上安装了该软件包python-numpy
。不幸的是,该软件包已损坏:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: cannot import name multiarray
Python 在 Ubuntu 上经常出问题吗?Numpy 是一个非常基本的软件包。
答案1
OP解决了这个问题:
...我发现了问题。我使用了错误的 Python,因为我安装了蟒蛇. 删除 anaconda 使系统正常运行
无需卸载 Anaconda 的另一种方法,将 python 链接重置为默认值(从存储库指向 python2)
$ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 Dec 10 2015 /usr/bin/python -> python2.7