plex plex - 5 months ago 19
Python Question

Install Numpy in Python 3.4.4 and Linux

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?

Answer

From python docs, when working with multiple versions of Python installed in parallel:

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

So, you should try:

~/$ sudo python3.4 -m pip install numpy
Comments