Reputation: 671
I am having issues packaging my script with py2exe. It works fine with Bundle=3, but I need an application that can run completely stand-alone with no extra files.
System:
win7x86
Python 2.7
Latest py2exe
I use the following libs in my application: 'Tkinter','ttk','time','tkFont','urllib2','md5','sys','os','hid'
This is my setup script:
from distutils.core import setup
import py2exe
DATA_FILES = []
APP = [{'script': 'app.py',
'name': 'app',
'icon_resources': [(1, 'icon.ico')]
}]
OPTIONS = {'py2exe':{
'includes':['Tkinter','ttk','time','tkFont','urllib2','md5','sys','os','hid',"encodings", "encodings.*"],
'bundle_files': 1,
'dist_dir': './Win_Build/',
'compressed': 1,
'optimize': 1,
"dll_excludes": ['C:\\Python27\\tcl\\tcl8.5\\init.tcl',"C:\\\\Python27\\DLLs\\tcl85.dll", "C:\\\\Python27\\DLLs\\tk85.dll","C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*"]
}}
setup(
windows=APP,
zipfile=None,
options=OPTIONS,
data_files=DATA_FILES,
version="2.0.0.0",
)
The problem is that when i run the application all i get it "App has stopped working Windows can check online for...."
I have tried multiple different suggestions I've found on the internet, but all either result in a non-stand-alone application and still won't run, or nothing changes at all in the build dir.
Thanks,
EDIT: I would like to avoid using pyInstaller if possible.
From: Python py2exe window showing (tkinter)
Changed dll excludes, and data_files...
"dll_excludes": []
DATA_FILES = ['C:\\Python27\\DLLs\\tcl{0}.dll'.format(TCL_VERSION.replace('.','')),'C:\\Python27\\DLLs\\tk{0}.dll'.format(TK_VERSION.replace('.',''))]
Unfortunately this has no effect.
Upvotes: 1
Views: 1249
Reputation: 51
in the link is written: Add "dll_excludes": ["tcl85.dll", "tk85.dll"] and copy dll manually.
Upvotes: 3