[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] PIL Error



I'm getting a weird error, which first appeared when I tried to build my
program into an EXE using py2exe. This version of the program uses PIL
rather than Pygame, but maybe someone here will know the answer.

My program loads image files. This works in IDLE or when double-clicking
on the source code. But when running it as an EXE, the image loading
explodes:

<code>
File "Image.pyc", line 1745, in open
IOError: cannot identify image file
</code>

I put the same image file into the dist directory as I was using in the
source code directory, and when I ran the EXE I did so from a DOS prompt
in the dist directory, so it should have no problem finding the file.
Any idea why compiling the EXE would cause this error?

Kris

Is there a libpng/libjpg in your dist directory? That might be it.

As far as I can tell, no. In fact, though I remember reading that PIL required ZLib to run properly (http://www.pythonware.com/library/pil/handbook/formats.htm), my list of downloaded files doesn't show that I ever downloaded it! Does this mean I should download and install it, then pull some file/directory out of it and put a copy in the dist directory of my program, even though it apparently runs as source code without the library?


Kris