I have been literally struggling to install numpy for python 2.7 and not 3.4 both of which are on my ubuntu. I have tried:
sudo pip2 install numpy
but it says
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib/python2.7/dist-packages
but when I go to the python shell, and type import numpy
, it throws an ImportError
python --version prints `Python 2.7.5`
I have no idea what the problem is even after looking at various answers to other SO questions. Is numpy installed and I'm not able to use it for some reason or isn't it installed? Please help.
First, do pip uninstall numpy
and pip2 uninstall numpy
just to clean up any old files.
Then, since you are on Ubuntu, you should just run
sudo apt-get install python-numpy
This will install numpy for python2. If you later choose you want it for python3, just run
sudo apt-get install python3-numpy
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