Thursday, August 11, 2011

Trying Ubuntu Linux (2)


I'm installing software on Ubuntu 11.0.4 (in a Virtual Box VM running under OS X Lion) and my standard test is matplotlib. To begin with, Ubuntu 11.0 has python but does not have numpy. So, let's start there.

I found build instructions here, but didn't actually follow them. Instead, I took their advice and used apt-get. While I was still thinking I would build everything I did:

sudo apt-get install gfortran

sudo apt-get install python-dev

And then I went after BLAS, and LAPACK. Based on the library name on this page, I did:

sudo apt-get install libblas3gf

And using the library name from this page, I did:

sudo apt-get install liblapack3gf

Then, I just did:

sudo apt-get install python-numpy

And, amazingly enough, it works:

>>> import numpy

>>>

Now:

sudo apt-get install zlib-bin

sudo apt-get install libpng3
sudo apt-get install libfreetype6
sudo apt-get install python-matplotlib
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/t/tcl8.5/tcl8.5_8.5.9-2_amd64.deb Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Oops..

sudo apt-get update


And now it gets tcl8.5

What else to do for matplotlib?
Nothing!

We'll try the example from here, and we get a png in the right place, which I just double click and get the graphic at the top. Here is the whole Desktop:



I really can't take any credit for this. I am very impressed speechless with the Ubuntu dev guys.

[ UPDATE: Did the same apt-get for scipy and the test at the bottom of this post works too! ]