2

I have python 2.7, and I installed beside it python 3.4, but python 3.4 has not numpy package. When I use sudo pip install -U numpy, it install it in python2.7 location. How can I install numpy for python 3.4 in a machine that has already python 2.7?

Sakib Ahammed
  • 2,452
  • 2
  • 25
  • 29
sss
  • 1,307
  • 2
  • 10
  • 16

2 Answers2

3

You're close, to update a package for python3.4 you have to sudo pip3 install -U numpy (note the pip3).

It might be the case that you still have to install pip3 first (not sure if it is bundled). Probably for that you have to sudo apt-get install python-pip3 or something. If you have a recent Ubuntu (I believe starting from 14.10), then you already have python 3.4 when you first boot up Ubuntu, as well as pip3 pre-installed.

You can also install through ubuntu's package manager, but if you want an OS independent way, you can just use pip3.

PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
2

Just install numpy for Python 3 in Software center or in terminal

sudo apt-get install python3-numpy
pacholik
  • 8,607
  • 9
  • 43
  • 55