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:
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:
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
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
- http://www.martin-geber.com/weblog/2007/08/22/problems-installing-easy_install-pil/: Installation succeeded, but for some reason Django still couldn't find the PIL library.
- http://effbot.org/zone/pil-index.htm: In addition to installing the PIL dmg, you also have to install their python2.5 dmg, which I wasn't keen to do.
- http://paul.annesley.cc/articles/2007/11/19/django-and-python-imaging-library-pil-on-leopard: If you like building from source, this solution may work for you. I prefer using packages since it makes deinstallation easier.
- http://py25-pil.darwinports.com/
- http://py-pil.darwinports.com/
Comments:
for python2.4 (using Zope and Plone) you do teh same with py-pil:
sudo /opt/local/bin/port install py-pil
Post a Comment
sudo /opt/local/bin/port install py-pil