[Image-SIG] Freezing with PIL

CLAY SPENCE cspence at sarnoff.com
Tue Oct 3 16:17:33 CEST 2006


I am trying to freeze a program that uses the Image module under 
Windows, using visual studio .net 7.1. I'm having a problem that seems 
to be a failure to find some module/library/.pyd/.lib file(s).

When I run the resulting executable, it raises an IOError in Image.open, 
saying "Cannot identify image file." My program sets sys.path, rather 
than appending to it, so I can distribute all necessary libraries with 
the executable. This is suggested in the freeze documentation. If I 
change the code to append to sys.path instead, everything runs fine. So, 
I assume there is some library or module that it can't find without the 
standard sys.path, but doesn't complain about not finding. How do I find 
out what's missing? I didn't find an answer in the freeze or PIL 
documentation (which doesn't prove it isn't there).

More detail, in case it matters:

When I run "python <python>\Tools\freeze\freeze.py program.py", early on 
it prints a path for _imaging.pyd, but near the end it complains with 
the message "No definition of module _imaging in any specified map 
file." I gather this is some set of compiler parameters I need to give 
to freeze. Freeze gives the same complaint for a few other modules.

It also says "Warning: unknown modules remain: _imaging ..." I 
understand this means I need to distribute the .pyd (and .lib?) files 
with the executable. I set sys.path to point into a lib directory 
containing those .pyd and .lib files that I can identify, including 

Indulging in wishful thinking, it seems to build Ok after this with nmake.


More information about the Image-SIG mailing list