I've managed this with icons (.ico files). You need to have the imageformats folder in your application directory, and have the required PyQt dlls in there. If you're using an installer get that to copythe dlls into r the app directory,


On 31/01/2011 10:23, Stephen Dranger wrote:
On Mon, Jan 31, 2011 at 2:48 AM, Stephen Dranger <dranger@gmail.com> wrote:
On Mon, Jan 31, 2011 at 1:52 AM, Mark Hammond <skippy.hammond@gmail.com> wrote:
On 30/01/2011 8:15 PM, Stephen Dranger wrote:
For some reason on my system (Windows XP 32-bit, Python 2.6) PyQt is
able to display gifs perfectly when run in the python interpreter, but
when I run it through py2exe, they no longer display.

I've tried everything I've googled: copying the gif DLLs from PyQt
into an imageformats/ folder, done a setLibraryPaths to where the
imageformat DLLs were, copied the setup file from

Nothing seems to work -- what on earth could I be doing wrong?
I'd guess pyqt dynamically loads the DLLs from a known location - but how it
determines that location in a py2exe environment isn't obvious - you could
try pyqt mailing lists or follow the clue about the imageformats folder -
eg, try it in various different locations - you may find the imageformats
folder is expected to be relative to one of the pyqt's modules __file__
attribute etc - but only the pyqt guys can help you with the intricate
details of that...



I did some tests, and I found (via ProcessExplorer) that when I run it
as a python script, it loads the Qgif.DLL from
C:\Python26\Lib\<pathtoQTDLLs>. When I copy those files and move them
to imageformats inside the dist/ directory, the application made from
py2exe uses them -- but it still doesn't work. It seems that both the
python script running and the py2exe executable both use the exact
same DLLs (except that py2exe doesnt seem to load socket libs, but
that's fine because network stuff runs perfectly fine).

What might be another symptom is that the pygame.mixer module works in
the same way -- it works fine in a python script, but doesn't work at
all in a py2exe executable.

Sorry for sending more than one email, but I just tried this with
cx_freeze, and it worked after copying the imageformats folder into
the application folder.

Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
Py2exe-users mailing list


Principal Power Systems Consultant
TNEI Services Ltd
Phone: 44(0)161 615 6002
Mobile: 44(0)7833 912 604 
Fax: 44(0) 161 615 6001
IPSA Website: www.ipsa-power.com
TNEI Website: www.tnei.co.uk

This email has been sent by TNEI Services Ltd, Bainbridge House, 88-90 London Road, Manchester, M1 2PW. Registered in England and Wales No 03891836. Registered office: 117 Jermyn St, London, SW1Y 6HH - VAT No 844279796.