>However, when I use py2exe in order to produce a .exe, the .exe crashes at startup.|
>Do you know what could be the cause ?|
The only possibility that comes to mind is that since the ProgressDialog on Windows is implemented using a native widget that there may be some conflict between it and how py2exe creates the executables. You might try using different bundle_files options. Also, I've found in the past that I also needed to exclude some DLLs that py2exe would try to include by default. Try adding
Thanks a lot in advance if you have some ideas about that.
By the way, did you experience the same problem on your Windows machine?
J
···
On Saturday, February 8, 2014 11:39:38 PM UTC+1, Robin Dunn wrote:
The only possibility that comes to mind is that since the ProgressDialog
on Windows is implemented using a native widget that there may be some
conflict between it and how py2exe creates the executables. You might
try using different bundle_files options. Also, I’ve found in the past
that I also needed to exclude some DLLs that py2exe would try to include
by default. Try adding
Hello Robin,
Thanks for your answer.
If I remove the "bundle_files = 1", there is no more crash. But I really
liked the fact of bundling all the files into one single .exe.
It is strange because I use lots of other wx widgets, and no other
caused a crash with py2exe + "bundle_files = 1".
I tried with GenericProgressDialog and DLL_excludes, but none of these
solved the problem.
Would you mind sharing your setup script that you are using with py2exe? I ran into similar issues (not with the progress dialog specifically) and had to explicitly include various packages.
Here is an example of what I mean:
List of python modules to exclude from the distribution
excludes = [
‘Tkinter’,
‘doctest’,
‘unittest’,
‘pydoc’,
‘pdb’,
‘curses’,
‘email’,
‘_tkagg’,
‘_gtkagg’,
‘bsddb’,
‘tcl’
]
List of dll’s (and apparently exe’s) to exclude from the distribution
if any Windows system dll appears in the dist folder, add it to this
list.
dll_excludes = [
‘API-MS-Win-Core-LocalRegistry-L1-1-0.dll’,
‘MPR.dll’,
‘MSWSOCK.DLL’,
‘POWRPROF.dll’,
‘profapi.dll’,
‘userenv.dll’,
‘w9xpopen.exe’,
‘wtsapi32.dll’,
‘libgdk-win32-2.0-0.dll’,
‘libgobject-2.0-0.dll’,
‘tcl84.dll’,
‘tk84.dll’
]
package_includes = [
‘gzip’,
‘xlrd’,
‘lxml’,
‘inspect’,
‘dialogFilter’,
‘sqlalchemy’,
‘wx.lib.pubsub’,
‘dialogHelp’,
‘ctypes’,
‘images’,
]
py2exe_options = {
‘optimize’: 2,
‘excludes’: excludes,
‘dll_excludes’: dll_excludes,
‘packages’: package_includes,
‘xref’: False,
‘bundle_files’: 1
}
setup(data_files = data_files,
windows=[{
‘script’ : ‘<program_name_here>.py’,
‘dest_base’:‘<program_name_here>’
}],
version=‘’,
options={‘py2exe’: py2exe_options},
zipfile = None
)
···
On Sunday, February 9, 2014 3:39:44 PM UTC-5, Robin Dunn wrote:
Basj wrote:
Hello Robin,
Thanks for your answer.
If I remove the “bundle_files = 1”, there is no more crash. But I really
liked the fact of bundling all the files into one single .exe.
It is strange because I use lots of other wx widgets, and no other
caused a crash with py2exe + “bundle_files = 1”.
I tried with GenericProgressDialog and DLL_excludes, but none of these
On Monday, February 10, 2014 2:23:34 PM UTC+1, Mike Stover wrote:
Would you mind sharing your setup script that you are using with py2exe? I ran into similar issues (not with the progress dialog specifically) and had to explicitly include various packages.
Here is an example of what I mean:
List of python modules to exclude from the distribution
excludes = [
‘Tkinter’,
‘doctest’,
‘unittest’,
‘pydoc’,
‘pdb’,
‘curses’,
‘email’,
‘_tkagg’,
‘_gtkagg’,
‘bsddb’,
‘tcl’
]
List of dll’s (and apparently exe’s) to exclude from the distribution
if any Windows system dll appears in the dist folder, add it to this
list.
dll_excludes = [
‘API-MS-Win-Core-LocalRegistry-L1-1-0.dll’,
‘MPR.dll’,
‘MSWSOCK.DLL’,
‘POWRPROF.dll’,
‘profapi.dll’,
‘userenv.dll’,
‘w9xpopen.exe’,
‘wtsapi32.dll’,
‘libgdk-win32-2.0-0.dll’,
‘libgobject-2.0-0.dll’,
‘tcl84.dll’,
‘tk84.dll’
]
package_includes = [
‘gzip’,
‘xlrd’,
‘lxml’,
‘inspect’,
‘dialogFilter’,
‘sqlalchemy’,
‘wx.lib.pubsub’,
‘dialogHelp’,
‘ctypes’,
‘images’,
]
py2exe_options = {
‘optimize’: 2,
‘excludes’: excludes,
‘dll_excludes’: dll_excludes,
‘packages’: package_includes,
‘xref’: False,
‘bundle_files’: 1
}
setup(data_files = data_files,
windows=[{
‘script’ : ‘<program_name_here>.py’,
‘dest_base’:‘<program_name_here>’
}],
version=‘’,
options={‘py2exe’: py2exe_options},
zipfile = None
)
On Sunday, February 9, 2014 3:39:44 PM UTC-5, Robin Dunn wrote:
Basj wrote:
Hello Robin,
Thanks for your answer.
If I remove the “bundle_files = 1”, there is no more crash. But I really
liked the fact of bundling all the files into one single .exe.
It is strange because I use lots of other wx widgets, and no other
caused a crash with py2exe + “bundle_files = 1”.
I tried with GenericProgressDialog and DLL_excludes, but none of these
To distribute as a single 'exe' file I would recommend using something like InnoSetup which is way superior to what py2exe can do with the bundle option.