Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python with PIL and Libjpeg on Leopard

I'm having trouble getting pictures supported with PIL - it throws me this:

IOError: decoder jpeg not available

I installed PIL from binary, not realizing I needed libjpeg.

I installed libjpeg and freetype2 through fink.

I tried to reinstall PIL using instructions from http://timhatch.com/ (bottom of the page)

  • Download PIL 1.1.6 source package and have the Developer Tools already installed
  • Patch setup.py with this patch so it can find the Freetype you already have.

    patch -p0 < leopard_freetype2.diff

  • sudo apt-get install libjpeg if you have fink (otherwise, build by hand and adjust paths)

But I'm still getting the same error.

I'm on Leopard PPC.

like image 450
thescreamingdrills Avatar asked Mar 21 '26 21:03

thescreamingdrills


1 Answers

I had the similar 'jpeg decoder problem' recently when deploying a django project on a product RHEL box that required PIL. I downloaded PIL, and ran 'python setup.py install' instantly, and was happy that everything was working, until I bumped into the problem. Solution: libjpeg was already installed on the system, so I installed libjpeg-devel. I went back into the source of PIL and ran 'python setup.py build', at the end of which, in the output where it shows whether PIL configure was able to detect support for jpeg, gif, freetype, etc, it said that jpeg support was ok. After installing PIL, it worked fine.

like image 144
ayaz Avatar answered Mar 23 '26 11:03

ayaz