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 jpeg
3.
$ workon {your virtual env}
# using virtualenvwrapper4. if reinstalling:
$ pip uninstall PIL
5.
$ pip install --no-install PIL
6. edit setup.py in {your virtual env dir}/build/PIL
***setup.py*** - also showing freetype and little cms if needed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# snip!! | |
JPEG_ROOT = libinclude("{homebrew install absolute dir}/Cellar/jpeg/8c") | |
FREETYPE_ROOT = libinclude('/usr/X11') | |
# snip!! |
7. save and close setup.py
8.
pip install PIL