Installing Python, MatPlotLib & iPython on Snow Leopard
As I have detailed in a previous post the installation of MatPlotLib on Mac OS was a fairly involved process involving the using of Mac Ports to compile and build a complete Python stack. Thankfully it would seem things have become much simpler on Mac OS X 10.6.7 if you are installing Python 2.7.1, MatPlotLib 1.0.1 and iPython 0.10.1. Note: currently only the 32 bit version of Python will work consistently with MatPlotLib and iPython.
- First Python 2.7.1:
- Download the prebuilt ‘Python 2.7.1 Mac OS X 32-bit i386/PPC Installer’ DMG from python.org.
- Mount the DMG image and run the contained installer.
- Verify it worked by opening a terminal and running the command ‘python -V’ which should return ‘Python 2.7.1′.
- Next MatPlotLib 1.0.1:
- Download the prebuilt ‘matplotlib-1.0.1-python.org-32bit-py2.7-macosx10.3′ DMG from MatPlotLib’s SourceForge page.
- Mout the DMG image and run the contained installer.
- Verify this worked by opening a terminal, running python and then ‘import matplotlib’ followed by ‘print matplotlib.__version__’ which should return ’1.0.1′.
- Finally iPython 0.10.1:
- Download the iPython source ‘ipython-0.10.1.zip’ from the iPython download directory.
- Extract the zip file.
- Open a terminal window and CD into the newly extracted directory ‘ipython-0.10.1′.
- Run the command ‘sudo python setup.py install’ and enter your password when prompted.
- Verify this by running iPython with MatPlotLib via ‘ipython -pylab’ and then ‘x = randn(10000)’ followed by ‘hist(x, 100)’ and a chart window like the following image should pop up.

You can leave a response, or trackback from your own site.







Nice, thanks for info. I prefer to install EPD, which contains a lot of additional packages, and everything I need for plotting, computations, ..
I hadn’t heard of EPD till your comment, that is a pretty solid looking set of tools, shame I’m not in academia any more so I’d have to pay for it.
Thanks for the useful post, just an additional note: before I could run matplotlib I had to install numpy (downloaded numpy-1.5.1-py2.7-python.org-macosx10.5) as it’s neither included in the python.org DMG image nor in matplotlib DMG itself. And for running the ipython binary I had to create a symlink manually to /usr/local/bin. Cheers, M.
The other option would be sagemath or maybe pythonxy if you have windows.
“Note: currently only the 32 bit version of Python will work consistently with MatPlotLib and iPython.” — is that true on Linux or only OS X? I have had some trouble getting MatPlotLib working with 64-bit python on linux, but I figured I was doing something wrong and just needed to spend more time on it.
I’m not sure about MatPlotLib’s 64 bit support on Linux as I’ve not used Linux for a while. I did have to switch to 32 bit on Windows to get it working though so perhaps that is your issue.
[...] Installing Python, MatPlotLib & iPython on Snow Leopard (tags: leopard mac_osx ipython matplotlib via:zite) [...]
[...] Installing Python, MatPlotLib & iPython on Snow Leopard (tags: leopard mac_osx ipython matplotlib via:zite) [...]
I was able to install everything after python itself by using python’s super-easy “easy_install” feature. I just had to manually install gfortran first (there’s an easy .dmg download), as numpy depends on it, but after that was able to install iPython, numpy, scipy, and a bunch of other doodads quick and easy. Just remember to run under sudo…
Hi all, I got a successful install in /Applications/Python 2.7/ but my version in cl is still Python 2.6.1 which, on my mac lives in /Library/Python/2.6 … how did you solve the problem of multiple versions? Did you declare a path in .bashrc? If I python from cl I don’t get access to anything installed as it’s all in /Applications. Also likewise ‘sudo python setup.py install’ for ipython doesn’t work for me… it just tries to put it in with Python 2.6.1. I do have easy_install but it is also only linked to Python 2.6 in /Library/Python/ and has absolutely refused to install matplotlib or numpy so I’d like to just force it to use the one you recommend above. Any suggestions or path declarations you guys recommend?
Hi Elina,
I don’t remember having to do any tweaking to get Python 2.7 working from the command line but it was a while ago when I setup it up.
Modifying the .bashrc should do the trick though, although I just checked and I don’t even seem to have a .bashrc either.
[...] Thanks to @dpbrown Thanks Daniel for the post on getting iPython on my MBP:endlesslycurious.com/2011/04/06/ins… [...]
Hi there! I know this is an an old post, but would desperately appreciate any help! I’ve come across some issues trying to get matplotlib running. I am quite new to python and scripting in general – I no longer have my license for MATLAB and have been told this would be a great open source alternative.
I am running Snow Leopard on my macbook.. I downloaded and installed python 2.7.2 (32-bit) and the appropriate numpy, ipython, matplotlib DMG packages. When I check if each has installed properly, I can find the source directory and retrieve the version numbers just fine.
However, when I try to use pylab.. like type in “ipython –pylab”, an error saying:
“[TerminalIPythonApp] Error in enabling GUI event loop integration” comes up.. and then is followed by a slew of import errors.
If anyone has any thoughts on this, I would greatly appreciate it!
Did you try following Dan’s instructions (comment before yours) for installing 2.7.2? I’ve not tried updating it yet..