I posted a question before regarding this subject, and read other ones posted before, but none has successfully solved my problem.
I am trying to install PIL on Mac OS X Lion, as I need it for a Django application. I also need JPEG support, so I need a JPEG decoder as well.
I have tried to download the libjpeg sources and compile them, and install PIL, but it doesn't recognize the directory.
So what I would like, and I believe this exists somewhere, is a method to install both PIL and libjpeg with a package installer, without the need for any compilation whatsoever!
Thank you in advance for every reply.
I used the following binary to get libpng and libjpeg installed systemwide on OSX:
libpng & libjpeg for OSX
Because I already had PIL installed (via pip on a virtualenv), I ran:
This resolved the
decoder JPEG not available
error for me.UPDATE:
If encountering the error
encoder jpeg not available
, you may need to installlibjpeg
. If using Homebrew:For OSX, pip install PIL had:
Another post led to something that works.
Install the libraries from here.
I installed libjpeg and PIL on Snow and it was migrated without problems to Lion.
I think however that you have the same problem I faced with installing libjpeg 7 on Snow. The solution for me was :
I got this from a comment on this blog.
Afterwards you can reinstall PIL through pip or easy_install. Make sure all the compiled stuff from your last run is deleted (sometimes you need to do this manually). I used virtualenv and pip.
Make sure you have homebrew and pip, and then run:
Worth noting and good information to have whenever working with Python and PIL: If you use virtualenv (and I think it's a very good idea), PIL may not correctly detect the image libraries on your system and install without JPEG/PNG support. Use the pillow package for a compatible PIL fork that finds them correctly.
If you have macports installed, you should do a:
It's easier than the easy_install + libjpeg method since macports install the right dependencies.