Because there are so many different ways to install PIL, finding how to fix error on the web is not easy. This post is to help me and others of us who use and enjoy virtualenv, homebrew and pip.
1. Ensure Xcode is installed. Upgrading to OSX 10.7 Lion removes Xcode
2.
$ brew install jpeg3.
$ workon {your virtual env} # using virtualenvwrapper4. if reinstalling:
$ pip uninstall PIL5.
$ pip install --no-install PIL6. edit setup.py in {your virtual env dir}/build/PIL
***setup.py*** - also showing freetype and little cms if needed
7. save and close setup.py
8.
pip install PIL