matplotlib and scipy for i386/x86_64 version of python 2.7

In a fit of masochism I installed the i386/x86_64 binary of Python 2.7 for Mac, which is available from: on my laptop. Note that $ file $(which python) reports Mach-O executable i386 and Mach-O 64-bit executable x86_64 for this installation of python. I wanted to use scipy and matplotlib, which is where the trouble began because there are not binaries of those for python 2.7 for this architecture. Here is what I had to do:
$ wget 
$ sh setuptools-0.6c11-py2.7.egg
$ wget
$ tar xfvz pip-0.8.2.tar.gz
$ cd pip-0.8.2
$ python install
$ git clone git:// numpy
$ cd numpy/
$ python install
Note that you have to have gnu fortran (gfortran) installed to build scipy
$ svn co scipy
$ cd scipy
$ python build --fcompiler=gnu95
$ python install
$ wget
$ tar xfvz matplotlib-1.0.1.tar.gz
$ cd matplotlib-1.0.1
In make.osx, I made the following changes:
  • from: PYVERSION=2.6
    to: PYVERSION=2.7
  • from: ARCH_FLAGS=-arch i386-arch x86_64
    to: ARCH_FLAGS=-arch i386 -arch x86_64
  • replaced -arch i386 -arch x86_64
    with "$(ARCH_FLAGS)
    in the other FLAGS variables
  • commented out the fetching of libpng from the fetch target.
  • removed the line continuation characters and newlines (I don't think this was necessary, but it helped me debug the problems I was having).
  • from: cp .libs/libpng.a .
    to: cp .libs/libpng14.a ..
    in the png target.
In Makefile I made the changed "ppc" to "x86_64" Then I could:
$ git clone git://
$ export PREFIX=/full/path/to/my/prefix/dir
$ make -f make.osx fetch deps mpl_build mpl_install
$ cd ..
Add $PREFIX to my PYTHONPATH variable (in my bash_profile and source it).