Installing Python Imaging Library (PIL) on Snow Leopard with updated Python 2.6.2

Mike Lawrence picture Mike Lawrence · Sep 17, 2009 · Viewed 30.9k times · Source

I have a fresh install (started with a wiped drive) of Snow Leopard with the developer tools installed during the Snow Leopard installation.

I then installed Python 2.6.2, replacing the Snow Leopard default python 2.6.1. I've tried to install PIL by:

  1. easy_install
  2. pip
  3. downloading source and running python setup.py build manually.

All yield the same error (link to pip log: http://drop.io/gi2bgw6). I've seen others have had success installing PIL using the Snow Leopard default python 2.6.1, so I'm not sure why I'm having so much trouble getting it to work with 2.6.2.

Answer

Kyle Fox picture Kyle Fox · Feb 8, 2010

The problem I ran into was that PIL was being compiled against PowerPC architecture (-arch ppc).

Do this before setup/build/compile:

export ARCHFLAGS="-arch i386"

(Assuming you're on i386)