ImportError: no module named numpy

I am trying to run a program that requires installing Numpy. I thought this was so, because if I try sudo apt-get install python-numpy , it will tell 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 (in the program 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 in the README file. There must be no things from Numpy (and other Python modules to install) there?

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 
+4
source share
2 answers

You do not indicate where you are executing the commands. For teams, I think you are using Ubuntu 12.10 .

Ubuntu 12.10 uses Python3 by default (check it with python --version ). That way, when you run python setup ... you run it with python available by default. For what it's worth, weblog 3.3 requires Python 2.5, 2.6, or 2.7.

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

My shot of blue will be:

 $ python2.7 setup.py install 

If you have not installed python2.7, you should install it (probably the shell will suggest it).

+4
source

I solved this using the following command to install the numpy module on my Ubuntu system.

In debian / ubuntu:

 aptitude install python-numpy 
+2
source

Source: https://habr.com/ru/post/1469133/


All Articles