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
The Python "ModuleNotFoundError: No module named 'numpy'" occurs when we forget to install the numpy module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install numpy command.
Python numpy not found or no module named 'numpy' error appears when the module is not installed in the current working environment. Install the module using pip or conda to fix this issue. but make sure that you have installed it in current working environment.
Thonny uses its own virtual environment by default. Open "Tools => Manage packages" or "Tools => Open system shell" in order to install into this environment. For completeness I will add that once you are in the Thonny System Shell you can run either "pip" or "pip3" to install the module you need.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With