[python-win32] Recurring DLL error with py2exe

Werner F. Bruhin werner.bruhin at free.fr
Thu Aug 25 17:57:05 CEST 2011


On 08/25/2011 04:30 PM, Jacob Kruger wrote:
> Ok, where should I include that exclude line?
>
> I tried just copying it into the setup.py file a bit higher up, but not sure if needs to be specifically included in some part of it, and I found out if I also tried to tell it not to copy the MSVCRT subfolder it still generates that error so it must have something to do with the actual compilation processing of the external module or something, but, maybe if I just need to tell it to exclude those files from a specific spot in the setup.py file that could sort it out?
dll_exludes is a py2exe option, should we in your options dict - see below.
> Anyway, here's current source of my setup.py file:
> #---start of source---
> from glob import glob
> from distutils.core import setup
> import py2exe
> dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll', 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll']
> data_files = [
> ("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))
> ]
> #data_files= []
> options = {
>      "bundle_files": 1,
Option "1" is more trouble then it is worse - would recommend 2 and use 
a installer such as InnoSetup to deliver a single file.  Some of this is 
shown/explained on the wxPython wiki.
>      "ascii": 1, # to make a smaller executable, don't include the encodings
>      "compressed": 1, # compress the library archive
            "dll_excludes": dll_excludes,
>      }
>
> setup(
>      # The first three parameters are not required, if at least a
>      # 'version' is given, then a versioninfo resource is built from
>      # them and added to the executables.
>      version = "1.0.0",
>      description = "testingWxPython",
>      name = "aboutBox",
>      options = {'py2exe': options},
>
>      # targets to build
>      console = ["AboutBox.py"],
> data_files=data_files
>      )
> #---end of source---
>
> Could it also maybe be something to do with this line?:
>      console = ["AboutBox.py"],
>
> Since while setup.py is running in console mode, don't know if the resulting wxPython based .exe runs in a console mode window as such..?
No problem, it will show a console window and a second window is opened 
with the wxPython GUI.  This is sometimes handy to track down some 
tracebacks which don't show if you use "window".

Werner



More information about the python-win32 mailing list