[PyQt] Problem with apps build with Py2exe

Darryl Wallace darryl.wallace at prosensus.ca
Fri Jan 9 16:35:41 GMT 2009


Hello,

> Well, shouldn't py2exe include all required libraries? I'm having the same 
> problem here, I'll investigate some more this weekend, but if the problem is 
> some missing libraries there should be a way of including them in the "dist" 
>   
Not necessarily.  For example, it will not automatically include the 
QtSvg4 library because (in my installation anyways) this is considered a 
system library.  You can force this by overriding py2exe's "isSystemDll" 
and creating a list of dll's you want to include automatically in your 
setup.py script.  I use the following code below.    When py2exe is 
checking which dll's should be included, it first asks if they are 
system dll's; if so, they will not be included (since a system dll 
should be on the system by default?).

My guess is that it needs to be forced to include msvcp90.dll or 
something.  If it is a dll like the MS VC Runtime DLL then that needs to 
be included along side your exe (not packaged within it or it's 
library).  I would say in your setup.py script to manually copy it to 
your dist folder.

Darryl
--

Example (originally from 
http://eli.thegreenplace.net/2008/10/09/packaging-dlls-with-executable-made-by-py2exe/):
---------------------

# Override the function in py2exe to determine if a dll should be included.
dllList = ('yourLibraryName.dll')
 
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
        if os.path.basename(pathname).lower() in dllList:
                return 0
        return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

-------------------------


More information about the PyQt mailing list