Adding PIL (Python Imaging Library) to Mac OS X

I continue my newbie MacBook exploits, currently I’m enjoying the fragmented installation process on a Mac…why is it harder to get stuff installed than on both Ubuntu (lovely apt-get!) and Windows?

Installing the Python Imaging Library takes a couple of steps.  There is a 3rd party installer but it assumes you’ve installed their base Python2.5 install…but Py2.5 comes pre-installed on Macs now anyway.

Thankfully there are instructions here for adding a soft-link that lets the installer find the existing Python 2.5.  Next, get the PIL diskimage (via Python Mac) and this time it’ll install happily.

Next I created ~/.bash_profile (not .bash_rc as suggested in the article – it didn’t get picked up) and added the required:

export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/

and then I started Python, did ‘from PIL import Image’ and all was well.  Woot-te-toot, now on with coding another ShowMeDo Club series (on File I/O for Python Beginners).


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

1 Comment

  • that`s waht i am looking for. thx I love my mac bit without pil dango & pinax wont run :(