Can PIL be installed under Cygwin?

Andy Chase monkey at greyledge.net
Fri Mar 28 16:15:00 CET 2003


I've wasted the better part of my morning trying to install the Python 
Imaging library under Cygwin, and I've exhausted all related posts in 
the Google groups archive, and PIL related message boards around the web 
that I've found so far... I am a relative newbie to Python, however, so 
I hope I'll be forgiven if I've overlooked something obvious!

My platform: WindowsME (I know, I know), and Cygwin version CYGWIN_ME-4.90.

I installed Python 2.2.2 from the Cygwin installer, which places all of 
the Python related stuff into /lib/python2.2 (when in Cygwin), which is 
D:/cygwin/lib/python2.2 on my computer.

I have downloaded the PIL Windows binary for Python 2.2 and moved the 
PIL directory and PIL.pth under /lib/python2.2/site-packages.  Because 
the Cygwin Python installation doesn't include a DLLs directory, I 
placed _imaging.pyd and _imagingtk.pyd into /lib/python2.2/lib-dynload, 
which I have firmly established is on Python's path.

>From the python interpreter I can do

 >>>from PIL import Image

With no trouble.

However, when I try to run the sample 'viewer.py' script I get the dreaded

"The _imaging C module is not installed"

ImportError.  I even went so far as to try adding the DOS-style path 
with slashes forwards and backwards from within viewer.py itself:

import sys
sys.path.append("D:/cygwin/lib/python2.2/lib-dynload")
sys.path.append("D:\cygwin\lib\python2.2\lib-dynload")

But it makes no difference.  I also tried creating a DLLs directory and 
moving the .pyd files in there (and updating the path accordingly) to no 
avail.  From what I've read, if this was a version conflict I should be 
getting an explicit error to that effect, so I am just completely 
stumped.  Is this perhaps a problem specific to Python/PIL under Cygwin? 
  I would be extremely grateful for any ideas anyone might have!

Thanks,

-Andy
monkey at greyledge.net
http://andy.greyledge.net





More information about the Python-list mailing list