Ian Ozsvald picture

This is Ian Ozsvald's blog (@IanOzsvald), I'm an entrepreneurial geek, a Data Science/ML/NLP/AI consultant, author of O'Reilly's High Performance Python book, co-organiser of PyDataLondon, a Pythonista, co-founder of ShowMeDo and also a Londoner. Here's a little more about me.

High Performance Python book with O'Reilly

View Ian Ozsvald's profile on LinkedIn

ModelInsight Data Science Consultancy London Protecting your bits. Open Rights Group

31 March 2009 - 12:46Adding 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 | Tags: Python