I used to have numpy working earlier. Not sure what happened, but now I get the import error:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
I have tried uninstalling and reinstalling numpy using pip and apt (import error:module named numpy) as suggested in other answers, but that did not solve my issue. It says that I have the newest version of numpy:
$ sudo apt install python-numpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-numpy is already the newest version (1:1.13.3-2ubuntu1).
The following packages were automatically installed and are no longer required:
libllvm6.0 libllvm6.0:i386 libllvm7 libllvm7:i386
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.
$ python -c "import numpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy
Just to mention, numpy works fine in python3.
pip-2.x install numpy
. Get x from your python2 version. – Manas Singh Nov 23 '19 at 20:50type -a python
say? – steeldriver Nov 24 '19 at 00:26$ type -a python
– SKR Nov 24 '19 at 05:51/usr/bin
- likelynumpy
is only installed for the "system" version – steeldriver Nov 24 '19 at 14:05