For example, PyQt4 comes with an example application called imageviewer.pyw. After creating an executable version of this application, any attempts to open a jpg file will fail. Opening a png file, however, will work.
The solution to this problem is described in more detail here. To summarize, PyQt uses a plugin to display jpg images. This plugin is not automatically included when using the py2exe tool. To manually include these plugins, do the following:
- In the py2exe created dist directory, create a subdirectory named PyQt4.
- Copy the plugins folder from the PyQt install location (typically C:\PythonXX\Lib\site-packages\PyQt4).
- Paste the plugins directory into the newly create PyQt4 subdirectory.
- From the PyQt4 install location, copy the qt.conf file.
- Paste the file into the py2exe dist directory.
- Edit the file so that the prefix is equal to ./PyQt4
- Test that the application works properly.