22

On my Ubuntu 14.04LTS, for python3, I have

 >>> import numpy
 >>> import scipy
 >>> numpy.__version__
 '1.8.2'
 >>> scipy.__version__
 '0.13.3'

I want to update numpy and scipy to the most recent version 1.9.2 and 0.16.0, I tried with the following commands

sudo pip3 install --upgrade numpy
sudo pip3 install --upgrade scipy

both commands ran successfully, but the version numbers didn't change to 1.9.2 and 0.16.0 at all for both python packages (after restarting the computer). Anyone knows how to update to the most version? Thank you very much!!

3 Answers3

7

I found @David Foerster's comment quite helpful. I also had python3-numpy and python3-scipy installed, which was overriding my later install, so I simply issued:

sudo apt-get remove python3-numpy

And then all the proper versions were already there, as revealed by

pip3 show numpy
nograpes
  • 173
3

I had the same problem: sudo pip install --upgrade <package> ran correctly but the packages didn't actually get upgraded.

I just tried

sudo easy_install --upgrade numpy
sudo easy_install --upgrade scipy
sudo easy_install-3.4 --upgrade numpy
sudo easy_install-3.4 --upgrade scipy

and it worked: I now have numpy 1.11.0b3 and scipy 0.17.0 in both python and python3.

Adrian
  • 373
0

numpy can be updated with the pip Python package installer. pip can be hit or miss when trying to install some Python packages, because it's another package management tool which is installed alongside the Software Center, but pip does a good job of installing numpy.

Open the terminal and type:

sudo apt-get purge python-numpy
sudo apt install python-pip
pip install --user numpy

Another way of installing the latest version of numpy is inside a Python virtual environment. That way you can have your old version of numpy installed alongside the latest version of numpy and use both of them. Installing numpy locally inside a Python virtual environment does not require using sudo in the command:

pip install numpy
karel
  • 122,292
  • 133
  • 301
  • 332