Home > python, ubuntu > Install NumPy and SciPy on Ubuntu

Install NumPy and SciPy on Ubuntu

On Ubuntu 11.10, here is what I had to do:

sudo pip install numpy
sudo apt-get install libatlas-base-dev gfortran
sudo pip install scipy
sudo pip install matplotlib   # recommended

Line 2 was necessary for SciPy, otherwise it was complaining that BLAS and a Fortran compiler were missing. Note that gfortran replaces the package g77.

Categories: python, ubuntu Tags: , , , ,
  1. December 13, 2011 at 13:43

    In the old days I used to just use synaptic package manager to install such things. It seems like a bit of a retrostep for Ubuntu to be pushing us away from GUIs and back to command prompt. Yes, yes, I know command prompt is not so bad, but neither was synaptic! And even installing synaptic can’t be done via the software centre. Does anyone understand why this is?

  2. December 13, 2011 at 13:45

    Actually I don’t have a “pip” command either, so I’m still struggling to figure out how to do something that used to take me about 5 seconds on earlier versions.

  3. December 13, 2011 at 16:30

    You can install pip via apt-get: “sudo apt-get install python-pip“. Then you can use “pip” for installing the newest versions of Python packages. pip for python is like apt-get for Debian-like systems. pip can resolve dependencies, which is awesome. Unfortunately the Ubuntu repos are sometimes out-of-date, so if you want the newest versions, I recommend using pip.

  4. Murpholino Peligro
  5. noiv
    July 15, 2012 at 16:11

    Above put me on the right path. Also did: sudo apt-get install libz-dev libpng-dev libfreetype6-dev python-dev to install matplotlib.

  6. November 29, 2012 at 12:38

    any way to install pymat through pip

  7. Phil
    February 26, 2013 at 22:06

    I just did:
    sudo apt-get install python-scipy

    • February 26, 2013 at 22:09

      That works too. But it comes from the Ubuntu repos that are often outdated. Via pip you get the newest version.

  8. April 9, 2013 at 16:46

    Problem with the Ubuntu repos is that it installs NumPy and SciPy for Python 2.7. If you only use Python 2, then Synaptic works just fine. However, they’ve recently become available for Python 3.x, which was great news, but it was still hard work — manually compiling both, plus their dependencies — last time I installed them.

  1. No trackbacks yet.

Leave a comment