How to install PIL on Mac OS X for Google App Engine?

If the following error message appears when starting an application using Google App Engine on Mac OS X: “Could not initialize images API; you are likely missing the Python “PIL” module. ImportError: No module named _imaging”

  1. Install MacPorts [1]
  2. Install Python 2.5 with sudo port install python25
  3. Install Pil for Python 2.5 with sudo port install py25-pil
  4. using the finder, open ~/.MacOSX/environment.plist and edit the PYTHONPATH variable [2]
  5. In the Google App Engine launcher Preferences set /opt/local/bin/python2.5 as Python Path
  6. Restart the Google App Engine launcher
  7. Run an application
  8. The error regarding PIL has disappeared
  9. Let’s code!

[1] http://code.google.com/appengine/docs/python/images/installingPIL.html

[2] Screenshot presenting the settings of the environment.plist file (PYTHONPATH=/opt/local/lib/python2.5/site-packages)

Edit the PYTHONPATH on ~/.MacOSX/environment.plist

Window presenting the environment variable named PYTHONPATH

window presents the environment variable PYTHONPATH
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s