Troubleshooting py2exe packaging issues

I wrote a setup.py script for py2exe, generated an executable for my python GUI application, and I have a whole bunch of files in the dist directory, including the w9xopen.exe application and MSVCR71.dll. When I try to start the application, I get an error message that simply says "see the log file for details." The only problem is that the log file is empty.

The closest error I've seen is “The following modules are apparently missing,” but I am not using any of these modules as far as I know (especially since they seem to be not using databases) but digging on Google suggests these are relatively mild warnings.

I wrote and packaged a console application as well as wxpython with py2exe, and both applications compiled and ran successfully. I am using a new python toolkit called dabo, which in turn uses wxpython modules, so I can't figure out what I'm doing wrong. Where should I start investigating the problem since obviously the log file was not too useful?

Change 1: The python version is 2.5. py2exe - 0.6.8. There were no significant assembly errors. The only bit was about “The following modules seem to be missing ...”, which were non-critical errors, because the packages listed were those that I definitely did not use, and should not stop the application. Running the executable created a log file that was completely empty. He used to have an error about locales, from which I have since corrected, but obviously something is wrong, since the executable file did not start. The setup.py file is largely based on the original setup.py generated when you launched your “application wizard” and looking at the example that Ed Leaf and others published. Yes, I have a log file and I am not printing anything for me, so I ask if there are any other troubleshooting omissions,which I missed, which will help me find out what is happening.

, GUI - . , - . , exe ( ), . .

2: , "" "" . !

:

import dabo
app = dabo.dApp()
app.start()

setup.py :

import os
import sys
import glob
from distutils.core import setup
import py2exe
import dabo.icons
daboDir = os.path.split(dabo.__file__)[0]

# Find the location of the dabo icons:
iconDir = os.path.split(dabo.icons.__file__)[0]
iconSubDirs = []
def getIconSubDir(arg, dirname, fnames):
    if ".svn" not in dirname and dirname[-1] != "\\":
        icons = glob.glob(os.path.join(dirname, "*.png"))
        if icons:
            subdir = (os.path.join("resources", dirname[len(arg)+1:]), icons)
            iconSubDirs.append(subdir)
os.path.walk(iconDir, getIconSubDir, iconDir)

# locales:
localeDir = "%s%slocale" % (daboDir, os.sep)
locales = []
def getLocales(arg, dirname, fnames):
  if ".svn" not in dirname and dirname[-1] != "\\":
    mo_files = tuple(glob.glob(os.path.join(dirname, "*.mo")))
    if mo_files:
      subdir = os.path.join("dabo.locale", dirname[len(arg)+1:])
      locales.append((subdir, mo_files))
os.path.walk(localeDir, getLocales, localeDir)

data_files=[("resources", glob.glob(os.path.join(iconDir, "*.ico"))),
        ("resources", glob.glob("resources/*"))]
data_files.extend(iconSubDirs)
data_files.extend(locales)

setup(name="basicApp",
        version='0.01',
        description="Test Dabo Application",
        options={"py2exe": {
                "compressed": 1, "optimize": 2, "bundle_files": 1,
                "excludes": ["Tkconstants","Tkinter","tcl", 
                "_imagingtk", "PIL._imagingtk",
                "ImageTk", "PIL.ImageTk", "FixTk", "kinterbasdb", 
                "MySQLdb", 'Numeric', 'OpenGL.GL', 'OpenGL.GLUT',
                'dbGadfly', 'email.Generator', 
                'email.Iterators', 'email.Utils', 'kinterbasdb', 
                'numarray', 'pymssql', 'pysqlite2', 'wx.BitmapFromImage'], 
                "includes": ["encodings", "locale", "wx.gizmos","wx.lib.calendar"]}},
        zipfile=None,
        windows=[{'script':'basicApp.py'}], 
        data_files=data_files
)
+5
2

, , .

.

, (, py2exe/python version, py2exe log, ).

+1

. http://www.wxpython.org/docs/api/wx.App-class.html wxPyton App. stderr, False redirect. , , , redirect True filename None.

+1

All Articles