简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM