我通过在 linux shell 中运行以下命令来安装 NumPy:
sudo apt-get install python-numpy
在 Idle for python 3.30 中,当我导入 numpy 时,它输出以下内容:
Python 3.3.0 (default, Sep 29 2012, 17:14:58)
[GCC 4.7.2] on linux
Type "copyright", "credits" or "license()" for more information.
>>> import numpy
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import numpy
File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 137, in <module>
from . import add_newdocs
File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 4, in <module>
from .type_check import *
File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 5, in <module>
from . import multiarray
ImportError: cannot import name multiarray
>>>
我还安装了 SciPy、matplotlib 和 mayavi2。当我导入它们时,它们也会出错。
为什么会发生这种情况。我怎样才能解决这个问题?