Python Imaging Library - Install Question

Warren Kirk warrenk at midwest.net
Wed Dec 15 09:21:26 EST 1999


Colleen & Brian Smith <greybria at direct.ca> wrote:
>If I try to run some of the example code in the manual, I get the following
>stack trace:
>
>>>> im=Image.open("C:\\Image Files\\b-29.jpg")
>>>> im.show()
>Traceback (innermost last):

[snip some traceback]

>  File "c:\Python\PIL\Image.py", line 40, in __getattr__
>    raise ImportError, "The _imaging C module is not installed"
>ImportError: The _imaging C module is not installed
>>>>
>
>I've installed PIL (95/NT 1.52 compatible version) in C:\Python\PIL and the
>_imaging.dll is installed there, C:\Windows\System and in C:\Python\DLLs.
>I've set the same $PYTHONPATH in my autoexec.bat as in the registry.
>
>SET
>$PYTHONPATH="C:\Python\Lib\plat-win;C:\Python\Lib;C:\Python\DLLs;C:\Python\L
>ib\lib-tk;c:\Python\PIL"
>
>What am I overlooking?

I don't know much about how dynamic libraries work, but on my
Linux box I had the same problem. Try to import _imaging directly
and see if that gives you an error from another library. The PIL
code delays reporting the _imaging import error until _imaging
is needed. (Look at the beginning of Image.py.) If import _imaging 
failed because of another library not being available, that 
information is lost.

>>> import _imaging
Traceback (innermost last):
  File "<stdin>", line 1, in ?
ImportError: /usr/lib/libtk8.0.so: undefined symbol: XFreePixmap
>>>

Anyway, if I import Tkinter, then everything works.

Warren



More information about the Python-list mailing list