.comment-link {margin-left:.6em;} <$BlogRSDURL$>

Tuesday, May 13, 2008

Installing Python PIL on Mac OS X 10.5.2 Leopard 

For some reason, the easy_install of python's PIL 1.1.6 imaging library didn't work for me or my coworkers when using Django.

After much trial-and-error using the various builds out there, the solution I found that works best for me was to use the one that comes with MacPorts.

After installing MacPorts, do the following:


sudo /opt/local/bin/port install py25-pil


Once the installation is complete, you'll need to supplement your PYTHONPATH with the location of the python libraries that macport uses. In your /etc/profile or ~/.profile, add the following line:


export PYTHONPATH=/opt/local/lib/python2.5/site-packages


That should be it! Works like a charm for me. Note that these instructions are for python 2.5. If you want python 2.4, you can probably install the py-pil package instead (although I haven't tried this myself)

Resources

Comments:
Thank you very much. It worked great for me
 
Great! Glad to hear it, sowmya
 
Thanks! Just what i was looking for!
 
Great! Thanks for leaving a note :)
 
for python2.4 (using Zope and Plone) you do teh same with py-pil:
sudo /opt/local/bin/port install py-pil
 
This FINALLY got PIL working on my machine! Thanks!
 
Post a Comment


This page is powered by Blogger. Isn't yours?