From: Thomas H. <th...@py...> - 2004-07-06 16:52:33
|
"Shan" <sha...@ho...> writes: > Hi, > > I have been trying to package a trivial PyQt application using py2exe, but I > don't seem to succeed. > The details are below. Would be grateful for any pointers on how I may > accomplish this. > > Regards, > Shan > [...] > Now the dist directory contains the following files: > _sre.pyd > hello1.exe > library.zip > python23.dll > qt-mt331.dll > qt.pyd > w9xpopen.exe > > Now I enter the dist directory and type "hello1.exe". Nothing happens. Then, > a small dialog pops up saying "See the logfile C:\trial\dist\hello1.exe.log > for details" First, when debugging the app or the build process, it may be easier to build a console instead of a windows version first - or build a console plus a windows version at the same time (there are samples which do this). The advantage is that you see tracebacks in the console window instead of having to look them up in the logfile. > hello1.exe.log contains: > Traceback (most recent call last): > File "hello1.py", line 5, in ? > File "qt.pyc", line 9, in ? > File "qt.pyc", line 7, in __load > ImportError: No module named sip > > I then tried to copy > sip.pyd > sipconfig.py > sipconfig.pyc > from the site-packages directory to the dist directory and ran "hello1.exe" > again. I got the same pop-up, and the hello1.exe.log file contained the same > message. The executables take care to _not_ import anything from the file system by accident, so the full pathname of the library.zip file is the only item in sys.path, and so the exe fails in the same way even when you copy these files manually to the dist dir. Note that extension modules cannot be loaded from a zipfile, so py2exe creates small Python loaders which import the extensions from the file system, and these loaders are included in the library.zip. I guess (never have used PyQT) you have to convince py2exe to include these files into the build. You should try '--includes=sip' or something similar. Thomas |