Installing numpy from Source on Ubuntu

Install build tools:

$ sudo apt-get install build-essential python-dev swig -y

Install appropriate atlas, blas, lapack libraries:

$ sudo rm -rvf /usr/lib{,64}/atlas/
$ sudo apt-get remove liblapack"*" -y
$ sudo apt-get remove libblas"*" -y
$ sudo apt-get --reinstall install libatlas-base-dev libatlas3gf-base -y

Install gfortran-4.2

$ sudo apt-get install gfortran-4.2 -y
$ sudo ln -sf /usr/bin/gfortran{-4.2,} 

Download and build numpy-1.3.0

$ mkdir -p ~/src && cd ~/src
$ sudo rm -rvf /usr/lib/python2.X/site-packages/numpy*
$ wget http://voxel.dl.sourceforge.net/sourceforge/numpy/numpy-1.3.0.tar.gz
$ tar xzvf numpy-1.3.0.tar.gz
$ cd numpy-1.3.0
$ sudo rm -rvf build
$ python setup.py build --fcompiler=gnu95
$ sudo python setup.py install
$ `cd ~/ && python -c "from numpy.linalg import lapack_lite"`

(Instructions by Nicolas Pinto)