[Image-SIG] PIL not working on Python 2.6

Christopher Brewster cbrewster at gmail.com
Thu Aug 6 18:18:01 CEST 2009


I am trying to use PIL on a MacBook Pro running Leopard. I have Python  
2.6 installed from Python.org.
An intermittent Python user I am trying to work my way through  
Segaran's Programming Collective Intelligence book.

I had some problems installing PIL so eventually I followed the  
instructions from here: http://codeblogmore.com/blog/2009/01/23/installing-pil-116-python-26-leopard/
and it passed its own tests.

However, now running some code from PCI, I get the following:

---
Wrong JPEG library version: library is 70, caller expects 62
Traceback (most recent call last):
   File "cluster.py", line 174, in <module>
     drawdendrogram(clust,blognames,jpeg='blogclust.jpg')
   File "cluster.py", line 36, in drawdendrogram
     img.save(jpeg, 'JPEG')
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/site-packages/PIL/Image.py", line 1405, in save
     save_handler(self, fp, filename)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/site-packages/PIL/JpegImagePlugin.py", line 409, in _save
     ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/site-packages/PIL/ImageFile.py", line 493, in _save
     raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file
---

This looks like a problem with PIL.
Is there a general problem with PIL and Python 2.6?
I am concurrently having a problem with ReportLab's installation which  
seems to be connected with PIL (but I will put that in a separate post).

Thank you for any help you can provide.

Christopher




More information about the Image-SIG mailing list