Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created March 4, 2012 16:50
Show Gist options
  • Save douglasmiranda/1973844 to your computer and use it in GitHub Desktop.
Save douglasmiranda/1973844 to your computer and use it in GitHub Desktop.
Install PIL with JPEG and PNG support in WebFaction. Just in case the "pip install PIL" not solve the problem in your shared host.
# Download
wget http://effbot.org/media/downloads/PIL-1.1.7.tar.gz
tar zxf PIL-1.1.7.tar.gz
cd PIL-1.1.7
# Edit setup file
vim setup.py
# Set the following variables
JPEG_ROOT = '/usr/lib64','/usr/include'
ZLIB_ROOT = '/lib64','/usr/include'
# build PIL
python2.7 setup.py build_ext -i
# Tah-dah
# --- PIL CORE support ok
# --- TKINTER support ok
# --- JPEG support ok
# --- ZLIB (PNG/ZIP) support ok
# --- FREETYPE2 support ok
# --- LITTLECMS support ok
# If you want to be sure, just run the tests
python2.7 selftest.py
# Install
python2.7 setup.py install
@BigAN
Copy link

BigAN commented Feb 24, 2014

hi,i just did as the gist shows.but still error appears as "The _imaging extension was built for another version ". can you help me ?

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