<pre>Chris--I thought I had mailed this Friday, but it never appeared in image-sig, <br>so here goes again.  I&#39;ll continue with the interleaved response-style.  Thanks<br>for the help--for my part, I&#39;m working through K&amp;R, hoping that this will teach<br>
me enough about compiling and linking C to puzzle out why this package isn&#39;t<br>installing seamlessly.<br><br>Mark<br><br>&gt;Mark Twenhafel wrote:<br>&gt;&gt;<i> Try adding<br></i>&gt;&gt;<i> <br></i>&gt;&gt;<i>    print Image.core.__file__<br>
</i>&gt;&gt;<i> <br></i>&gt;&gt;<i> to your script and make sure that the output is what you expect.<br></i>&gt;<br>&gt;what was the result of that?<br><br>redpoint:~/sandbox/python/persfin1 mark$ python<br>Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) <br>
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>&gt;&gt;&gt; import Image<br>&gt;&gt;&gt; print Image.core.__file__<br>
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so<br>&gt;&gt;&gt; <br><br><br>&gt;<br>&gt;&gt;<i> At this point, my working hypothesis is that I did not install libjpeg <br></i>&gt;&gt;<i> correctly.  I&#39;m working on OS X Tiger.  What I did was download <br>
</i>&gt;&gt;<i> &quot;jpegsrc.v8a.tar.gz&quot;; double-click in my download window in Firefox to <br></i>&gt;&gt;<i> untar; move the untarred &quot;jpeg-8&quot; folder to /Application; open Terminal <br></i>&gt;&gt;<i> and cd&#39;ed to /Applications/jpeg-8; finally, I ran &quot;./configure&quot;, &quot;make&quot;, <br>
</i>&gt;&gt;<i> and &quot;make install&quot;. <br></i>&gt;&gt;<i> <br></i>&gt;&gt;<i> It could be--and I don&#39;t know--that this install procedure did not <br></i>&gt;&gt;<i> correctly add libjpeg to my Python 2.6 installation<br>
</i>&gt;<br>&gt;no it wouldn&#39;t have done that.<br>&gt;<br>&gt;<i>&gt; or that I need to <br></i>&gt;&gt;<i> rebuild site-packages/PIL/_imaging.so in order to link-in libjpeg.<br></i>&gt;<br>&gt;indeed you do.<br>&gt;<br>
&gt;&gt;<i> Belated point of clarification: I subsequently installed PIL using the <br></i>&gt;&gt;<i> these instructions:<br></i>&gt;&gt;<i>         $ cd Imaging-1.1.7<br></i>&gt;&gt;<i>         $ python setup.py build_ext -i<br>
</i>&gt;&gt;<i>         $ python selftest.py<br></i>&gt;<br>&gt;that should have built a new PIL, but it won&#39;t have installed it.<br>&gt;<br>&gt;Did the selftest run OK?<br><br>redpoint:/Applications/Imaging-1.1.7 mark$ python selftest.py<br>
--------------------------------------------------------------------<br>PIL 1.1.7 TEST SUMMARY <br>--------------------------------------------------------------------<br>Python modules loaded from ./PIL<br>Binary modules loaded from ./PIL<br>
--------------------------------------------------------------------<br>--- PIL CORE support ok<br>--- TKINTER support ok<br>--- JPEG support ok<br>--- ZLIB (PNG/ZIP) support ok<br>--- FREETYPE2 support ok<br>*** LITTLECMS support not installed<br>
--------------------------------------------------------------------<br>Running selftest:<br>--- 57 tests passed.<br>redpoint:/Applications/Imaging-1.1.7 mark$ <br><br><br>&gt;<br>&gt;&gt;<i> I just noticed that the file &quot;site-packages/PIL/_imaging.so&quot; was created <br>
</i>&gt;&gt;<i> last October.<br></i>&gt;<br>&gt;which is why you are getting an old one here.<br><br>The last few lines of a long listing of PIL follow:<br><br>-rw-r--r--     1 root  admin     3047 Oct 11  2009 XpmImagePlugin.pyc<br>
-rw-r--r--     1 root  admin      231 Dec  3  2006 __init__.py<br>-rw-r--r--     1 root  admin      180 Oct 11  2009 __init__.pyc<br>-rw-r--r--     1 root  admin  1406408 Oct 11  2009 _imaging.so<br>-rw-r--r--     1 root  admin    87420 Oct 11  2009 _imagingft.so<br>
-rw-r--r--     1 root  admin    89240 Oct 11  2009 _imagingmath.so<br>-rw-r--r--     1 root  admin    54056 Oct 11  2009 _imagingtk.so<br>redpoint:/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL mark$ <br>
<br><br><br>&gt;<br>&gt;&gt;<i>  If so, would be be possible or likely that this was built <br></i>&gt;&gt;<i> using the version of libjpeg that didn&#39;t install on my machine?<br></i>&gt;<br>&gt;yup.<br>&gt;<br>&gt;&gt;<i>  If this <br>
</i>&gt;&gt;<i> is correct, what is the best way to proceed?  My first inclination is to <br></i>&gt;&gt;<i> delete the directory site-packages/PIL and reinstall. <br></i>&gt;<br>&gt;yup -- you may not even need to delete, but it won&#39;t hurt.<br>
&gt;<br>&gt;Take a look for a new _imaging.so that you should have just built. If <br>&gt;you really want to know what it&#39;s linked to, try:<br>&gt;<br>&gt;$ otool -L _imaging.so<br><br><br>Interpreting this is beyond me, at this point:<br>
<br>redpoint:/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL mark$ otool -L _imaging.so<br>_imaging.so:<br>        /usr/local/lib/libjpeg.7.dylib (compatibility version 8.0.0, current version 8.0.0)<br>
        /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)<br>        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)<br>redpoint:/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL mark$ <br>
<br><br><br>&gt;<br>&gt;But you might just do:<br>&gt;<br>&gt;setup.py install<br>&gt;<br>&gt;and see if it now works.<br><br>The following code still produces the following exception:<br><br>redpoint:~/sandbox/python/persfin1 mark$ cat ./mwm.py<br>
#!/usr/local/bin/python<br>from Tkinter import *<br>import Image<br>import ImageTk<br><br>class Application(Frame):<br>    def __init__(self, master=None):<br>        Frame.__init__(self, master)<br>        self.grid()<br>
        self.createWidgets()<br><br>    def createWidgets(self):<br>        self.cnv = Canvas(self)<br>        self.img = ImageTk.PhotoImage(Image.open(&quot;/Applications/Imaging-1.1.7/Images/lena.jpg&quot;))<br>        cvnitem = self.cnv.create_image(100, 100, image=self.img)<br>
        self.cnv.grid()<br><br>app = Application()<br>app.master.title(&quot;Sample application&quot;)<br>app.mainloop()<br><br>redpoint:~/sandbox/python/persfin1 mark$ ./mwm.py<br>Traceback (most recent call last):<br>  File &quot;./mwm.py&quot;, line 18, in &lt;module&gt;<br>
    app = Application()<br>  File &quot;./mwm.py&quot;, line 10, in __init__<br>    self.createWidgets()<br>  File &quot;./mwm.py&quot;, line 14, in createWidgets<br>    self.img = ImageTk.PhotoImage(Image.open(&quot;/Applications/Imaging-1.1.7/Images/lena.jpg&quot;))<br>
  File &quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/ImageTk.py&quot;, line 116, in __init__<br>    self.paste(image)<br>  File &quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/ImageTk.py&quot;, line 166, in paste<br>
    im.load()<br>  File &quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/ImageFile.py&quot;, line 180, in load<br>    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)<br>  File &quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.py&quot;, line 375, in _getdecoder<br>
    raise IOError(&quot;decoder %s not available&quot; % decoder_name)<br>IOError: decoder jpeg not available<br>redpoint:~/sandbox/python/persfin1 mark$ <br><br><br>&gt;<br>&gt;We really do need to get a Mac binary built!<br>
&gt;<br>&gt;-CHB<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;-- <br>&gt;Christopher Barker, Ph.D.<br>&gt;Oceanographer<br>&gt;<br>&gt;Emergency Response Division<br>&gt;NOAA/NOS/OR&amp;R            (206) 526-6959   voice<br>
&gt;7600 Sand Point Way NE   (206) 526-6329   fax<br>&gt;Seattle, WA  98115       (206) 526-6317   main reception<br>&gt;<br><a href="http://mail.python.org/mailman/listinfo/image-sig">&gt;Chris.Barker at noaa.gov</a><br>
&gt;<br><br>Thanks to anyone looking at this.  Like I said, I want to get this running, but I&#39;m not asking<br>anyone to do my own debugging.  I&#39;ll keep hacking away at this at my level.<br><br>Mark<br><br><br></pre>