why doesn't NumPy import in idle 3.30 on Ubuntu 12.10 64 Bit

笑着哭i 提交于 2019-12-25 04:11:09

问题


I installed NumPy by running the following in a linux shell:

sudo apt-get install python-numpy

In Idle for python 3.30 when I import numpy it outputs the following:

    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
>>> 

I also have SciPy, matplotlib, and mayavi2 installed. They also through errors when I import them.

Why does this happen. How can I fix this?


回答1:


On my ubuntu 12.10. I use pip to install packages. I use Python3.2.

sudo apt-get install python3-pip
sudo pip-3.2 install numpy

I have tried this and installed numpy successfully.



来源:https://stackoverflow.com/questions/16096143/why-doesnt-numpy-import-in-idle-3-30-on-ubuntu-12-10-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!