[Image-SIG] Unable to import _imaging

Fredrik Lundh fredrik at pythonware.com
Sun Nov 7 00:46:31 CET 2010


On Sat, Nov 6, 2010 at 10:30 PM, Esben Bugge <esbenbugge at gmail.com> wrote:
> Hi
>
> I am trying to install PIL on Mac OS.X 10.6 for the purpose of using
> Satchmo. After installation I tried
>
> $ python
>>>> import PIL
>>>> import Image
>>>> import _imaging
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError:
> dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so,
> 2): Symbol not found: _jpeg_resync_to_restart
>   Referenced from:
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so
>   Expected in: dynamic lookup
>
> I believe that jpeglib (version 7) is properly installed: I am able to run
> the tests that are provided with the source of jpeglib.
>
> I am quite new to installing stuff via the command-line. I did a lot of
> searches on Google and found some guys with the same problem - but I have
> not been able to find a solution that fixes the problem for me. Any ideas on
> what I can check?

I *think* this is caused by a mismatch between jpeg-6a and jpeg-7 (or
8 or whatever the latest is) -- i.e. your compiler picks up the header
files for one of them, but when you run the program, the runtime
linker pulls in the other one and gets confused.  I know absolutely
nothing about the Mac OS X build & execution environment, though, so I
don't know where to look for that conflict.

The comments to this blog post contain several workarounds that may or
may not solve your problem:

  http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/

but for this non-Mac user, compiling stuff on Mac OS X seems to be
about as fragile as getting audio stuff to work on Linux :)

(This mail list is full of competent Mac hackers, though, so hopefully
one of them has more useful advice)

</F>


More information about the Image-SIG mailing list