Installing matplotlib in Lion

Given that Lion now has loads of spiffy Python updates and that one of the things I’m involved in is data visualization, I’ve already had to figure out how to install matplotlib to render some datasets.

At first, I tried doing:

export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig"
sudo easy_install matplotlib

…first to use the built-in pkgconfig, and take advantage of easy_install, but the only way to get things going was by using homebrew and git:

sudo brew install pkgconfig
cd Desktop/
git clone git://github.com/matplotlib/matplotlib.git
cd matplotlib/
python setup.py build
sudo python setup.py install

And that’s it, you’re good to go.