Quantcast
Channel: solem's vision blog
Viewing all articles
Browse latest Browse all 31

Installing PIL on OS X Mountain Lion

$
0
0
Installing PIL, the Python Imaging Library, on OS X sometimes gives problems with missing JPEG support. I have run into this problem before but could not find my solution so I'm adding it here as a note to self with "PIL" and "install" tags so I can locate the trick again in the future. Here's the procedure. 1. Get libjpeg from http://www.ijg.org/files/jpegsrc.v8c.tar.gz. Then in the unpacked folder:

./configure
make
sudo make install
2. Download PIL from http://effbot.org/downloads/Imaging-1.1.7.tar.gz. (Remove PIL first if installed already.) 3. In the unpacked folder:

python setup.py build --force
sudo python setup.py install
The magic part for me was "--force". Without it it doesn't work. If you still don't get "JPEG support available" in the console when you run the first build command, then you can try adding the path to libjpeg in setup.py (basically just replace the "None" with your path). For example like this:

JPEG_ROOT = "usr/local/lib"

Viewing all articles
Browse latest Browse all 31

Trending Articles