Skip to content

Instantly share code, notes, and snippets.

@zgohr
Created August 28, 2013 15:50
Show Gist options
  • Save zgohr/6367609 to your computer and use it in GitHub Desktop.
Save zgohr/6367609 to your computer and use it in GitHub Desktop.
OSX python pillow with jpeg support

pip install --upgrade --no-install pillow

This downloads and unpacks the library.

vim /my/venv/build/pillow/setup.py

Change JPEG_ROOT = None to JPEG_ROOT = libinclude("/Users/zach.gohr/Developer/Cellar/jpeg/8d") or wherever your libjpeg exists (I installed using brew install libjpeg and found via find / -name 'libjpeg'

If the libinclude function does not exist (exists in the case of PIL, not pillow) paste this into setup.py as well:

def libinclude(root):
    # map root to (root/lib, root/include)
    return os.path.join(root, "lib"), os.path.join(root, "include")

Finish installing pip install --upgrade pillow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment