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

Rick King rickbking at
Fri Aug 7 18:19:21 CEST 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 looks like the following.

from distutils.core import setup
import py2exe
import sys

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

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


FileTool = Target(
    description = "FileTool",
    script = "",
    other_resources = [(RT_MANIFEST, 1, manifest_template % 
    dest_base = "FileTool")

    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