5

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 

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

9 Comments

Hey, I have python 2.7 and Ubuntu 12.04. I added the results of trying dpkg -l python-numpy to my original post. I'm not sure but I think that says it's not installed?
I'm sorry, I meant dpkg -L python-numpy. It is installed (ii), also you already said you had installed. I just wanted you to check where the files were installed.
Seems like most of it is in /usr/lib/python2.7/ but since it's definitely installed I feel like that makes the results of the python setup.py install line all the more perplexing lol
Did you try python --version to check the version of python you are running by default?. Also check if you have defined the environment variable PYTHONPATH, which may be pointing out to a different place.
Version 2.7.3 so I'm good on that one. But checking my PYTHONPATH (which took awhile to figure out how to do lol) I see that dist-packages is not in there, and apparently that's where Python sticks new modules after version 2.6, so I need to add that Python2.7/dist-packages directory to the PYTHONPATH variable. I'm trying to figure out how but I'm having trouble haha
|
4

I solved it by using following command to install the numpy module in my Ubuntu system.

On debian/ubuntu:

aptitude install python-numpy 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.