0

I just installed Ubuntu 16.04 which includes Python 2.7.11 and 3.5.1.

I also installed Python 3.4.4 successfully. But when I try to install numpy with:

sudo apt-get install python-numpy 
sudo apt-get install python3-numpy 

it installs for Python 2.7.11 and 3.5.1 but I need it for Python 3.4.4. How do I install it?

Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
plex
  • 31
  • 1
  • 4

1 Answers1

4

From python docs: when working with multiple versions of Python installed in parallel, below commands can be used along with pip to install a Python Package for a particular version of Python:

python2   -m pip install SomePackage  # default Python 2
python2.7 -m pip install SomePackage  # specifically Python 2.7
python3   -m pip install SomePackage  # default Python 3
python3.4 -m pip install SomePackage  # specifically Python 3.4
python3.5 -m pip install SomePackage  # specifically Python 3.5

Hence, to install numpy package for Python3.4, you can use this command:

~/$ python3.4 -m pip install numpy
Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
  • 2
    Perfectly works! Thanks Orions! I upvoted, but will appear only when I have reputation more than 15 – plex Jun 21 '16 at 10:07
  • 1
    @plex you'll actually have to come back and upvote, [it doesn't automatically add your vote](http://meta.stackoverflow.com/questions/326060/change-the-wording-of-thank-you-for-your-feedback-when-a-user-below-125-re) – River Jun 21 '16 at 11:44