I have installed python3.4 on my amazon ec2 instance but wanted to install numpy for that particular python version as well. When I do a yum install numpy
it installed numpy but that is for the default python version which I had, python 2.6.
So here’s how I installed numpy for python 3.4. It’s actually very simple.
First install pip for that particular python version that you want to install numpy.
curl -O https://bootstrap.pypa.io/get-pip.py
/bin/python3 get-pip.py
Now you should have installed pip3 for your python3. You can install numpy now using pip3:
sudo pip3 install numpy.
When you use sudo with pip and if you are getting a ‘command not found’ error, that’s because the root environment is being different from the usual user’s environment. You can solve this by setting up an alias as below:
alias sudo='sudo env PATH=$PATH'.
Hopefully now everything is up and you are ready to go! Just do a sudo pip3 install numpy.