For what its worth, I think I fixed it. It seemed to be a freeze problem, not finding all of the modules. I copied knee.py from Python-*/Demo/imputil, modified it to print the names of successfully imported modules, and then froze versions of my program with the normal sys.path and with this replaced. I then looked for modules that weren't imported in the version that fails. The image file format plugins were missing, like PngImagePlugin. I put an explicit import statement for these into the main program file, and freeze now includes them. There is slightly odd python code for importing them in Image.py, and this hides them from freeze.

Clay

--- Begin Message ---
Hi,

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 _imaging.pyd.

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

Clay


--- End Message ---
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to