ImportError: No module named numpy

numpy, python

Solution

You do not mention where you are running the commands. For the commands, I guess you are using `Ubuntu 12.10`.

In Ubuntu 12.10 the default is Python3 (check it with `python --version`). So that, when you ran `python setup ...`, you are running it with the default python available. For what it is worth, weblog 3.3 requires Python 2.5, 2.6 or 2.7.

Also, you can check where python-numpy was installed (check it with `dpkg -L python-numpy`).

My shot out of the blue would be:

$ python2.7 setup.py install

If you do not have installed python2.7, you should install it (likely, the shell is going to suggest it).

Problem

I'm trying to run a program that requires Numpy to be installed. I thought it was, because if I try `sudo apt-get install python-numpy` it tells me that ``` sudo apt-get install python-numpy Reading package lists... Done Building dependency tree Reading state information... Done python-numpy is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ``` But then when I go to install the program I'm trying to (within that programs directory, where setup.py is located) I get: ``` python setup.py install Traceback (most recent call last): File "setup.py", line 20, in <module> from weblogolib import __version__ File "/home/chris/Documents/IS/Bioinformatics-Software/weblogo-3.3/weblogolib/__init__.py", line 108, in <module> from numpy import array, asarray, float64, ones, zeros, int32,all,any, shape ImportError: No module named numpy ``` When I look in the Python-2.7.3/Lib/site-packages directory the only thing that's in there is a README file. Shouldn't there be stuff from Numpy in there (and other install Python modules)? I am running Ubuntu 12.04 with Python 2.7 Using `dpkg -l python-numpy` I get: ``` Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii python-numpy 1:1.6.1-6ubunt Numerical Python adds a fast array facility ```

Original source