[Tutor] Idle - ImportError: No module named numpy

Dave Angel davea at davea.name
Sat Mar 7 04:03:21 CET 2015


On 03/06/2015 01:27 PM, Markos wrote:
> Hi,
>
> I'm beginning to study the numpy.
>

And what does this have to do with the
    """Strengths & weaknesses of Python lists compared to
    "old school" arrays [Was "Fixed Vector Array"]"""
thread?  Please don't hijack a thread by replying with an unrelated 
message.  Just start a new one with "Write email" or equivalent. 
Address it to tutor at python.org, and it'll be fine.


> When I open a terminal (Debian Squeeze) and run the python interpreter
> the command "import numpy as np" run without errors.
>
> But when I run the same command on idle3 the following error appears.
>
>  >>> import numpy as np
> Traceback (most recent call last):
>    File "<pyshell#0>", line 1, in <module>
>      import numpy as np
> ImportError: No module named numpy
>
> How configure idle to load the numpy module?
>

As others have said, you probably have a version mismatch.  When you ran 
Python from the terminal, what did you call it?  Which version did you get?

When you ran idle3, you presumably ran some version 3 installation of 
Python.

 From each interactive session, you can check the Python version with:

 >>>> import sys
 >>>> sys.version

Unless they're identical in the two environments you describe, you can't 
assume they'll both have numpy loaded.


-- 
DaveA


More information about the Tutor mailing list