py2exe-created exe results in "application failed to initialize"

Rick King rickbking at comcast.net
Fri Aug 7 12:19:21 EDT 2009


Hi everyone,
I want to package up an application into an exe using py2exe but the 
result produces the dreaded

"application failed to initialize 0x....142" error.

I'm using wxPython and basically just took the sample for wxpython GUI 
that came with py2exe and changed the name. My setup is python 2.6, 
wxpython 2.8. My setup.py looks like the following.

from distutils.core import setup
import py2exe
import sys

class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the versioninfo resources
        self.version = "0.1"
        self.company_name = "OWDC"
        self.copyright = "no copyright"
        self.name = "FileTool"

manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
.... etc.
'''

RT_MANIFEST = 24

FileTool = Target(
    description = "FileTool",
    script = "filetoolGUI.py",
    other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="FileTool"))],
    dest_base = "FileTool")

setup(
    options = {"py2exe": {"compressed": 1,"optimize": 2,"ascii": 
1,"bundle_files": 1}},
    zipfile = None,
    windows = [FileTool],
    )

Any help will be greatly appreciated!

Rick King
Southfield MI USA




More information about the Python-list mailing list