python - problem in executable created with py2exe -
i have application written in python uses pygtk built gui, glade files included window building.
my problem application works fine when run cmd, when create exe py2exe application doesn't start, creates empty log file writing in application logs.
my setup.py looks :
from distutils.core import setup import os import pygtk import py2exe setup( name = 'abc', description = 'blah blah blah', author = 'xyz', version = '0.1', windows = [ { 'script': 'filename.py', 'icon_resources': [(1, "logo.ico")], } ], options = { 'py2exe': { 'packages':'encodings', 'includes': 'cairo, pango, pangocairo, atk, gobject,gio', } }, data_files=[ 'logo.png', 'bg.png', 'completed.png', 'down.png','up.png', 'processing.gif', 'cygcrypto-0.9.8.dll', 'cyggcc_s-1.dll', 'cygiconv-2.dll', 'cygpopt-0.dll', 'cygssp-0.dll', 'cygwin1.dll', 'cygz.dll', 'prog.exe','prog2.exe', 'prog3.exe', 'login.glade', 'settings_lib.glade', 'microsoft.vc90.crt.manifest', 'msvcm90.dll','etc.zip', 'lib.zip', 'msvcp90.dll', 'msvcr90.dll', 'share.zip' ]) what problem?
i had problems quite few times when using tools py2exe , py2app.
iirc, many times caused python process's working directory being different when .exe double-clicked. may want add code startup of python program logs value of os.getcwd()
the other thing tricky have make sure py2exe bundles in python modules program using. when running command-line, you're using python has modules. when double-clicking .exe, you're using python bundled executable along modules you've explicitly listed in setup.py -- it's easy miss one. find this, put try/except clauses around imports , logging importerror exceptions file.
Comments
Post a Comment