Search code examples
pythonosx-snow-leopardpython-imaging-library

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


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.


Solution

  • The python.org Python was built with an earlier gcc. Try using gcc-4.0 instead of SL's default of 4.2:

    export CC=/usr/bin/gcc-4.0
    

    See similar problem here.

    That gets past the stdarg problem. You may then run into later build problems with various dependent libraries.

    BTW, gcc-4.0 and gcc-4.2 are both included with Snow Leopard's Xcode 3 so no additional installs are needed.

    UPDATED 2011-05: Note, that the newer Xcode 4, released for experimental use with 10.6 and expected to be standard with 10.7, no longer includes PPC support so, if you install Xcode 4, this suggestion will not work. Options include using the newer 64-bit/32-bin Python 2.7.x installers from python.org or installing a newer Python 2.6 and PIL and the various 3rd-party libs using MacPorts, Homebrew, or Fink.