我现在非常被迫使用python 3.3,但每次我想加载numpy库时都会出错。错误如下:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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
Numpy在python 3.2上运行良好,但由于某些原因,它变得非常难看。 我做的一种方法是评论。导入多阵列,但它还有另一个错误。也许有人已经遇到过这个问题。我很感激你的帮助。
答案 0 :(得分:0)
我终于得到了它们。首先要做的是下载分发设置并使用python3.3安装它。那就安装了easy_install。请参阅此处的简短代码:
wget http://python-distribute.org/distribute_setup.py
sudo python3.3 -m distribute_setup install
sudo easy_install-3.3 pip
sudo pip3.3 install numpy
如果最后一个命令告诉你已经有numpy,只需执行:
sudo pip3.3 install -U numpy