【发布时间】:2011-05-18 08:07:42
【问题描述】:
Py2exe 似乎运行良好,尽管它确实提到可能缺少一些模块。
我一直在使用 windows 选项(在我的 py2exe 脚本中)来删除控制台窗口,但我意识到即使我关闭了 gui 窗口,该进程仍然保持打开状态,即我仍然可以在任务管理器中看到该进程。 . 所以我切换到使用控制台选项,发现那里打印了以下错误。我相信这个错误会阻止应用程序关闭。除此之外,该应用程序运行良好。
我尝试从一个非常简单的 wxPython GUI 应用程序创建一个 exe,但即便如此我仍然收到此错误,但是我从不包含 wxPython 的应用程序创建可执行文件没有问题。
Debug: src/helpers.cpp(140): 'createActCtx' failed with error 0x0000007b (the filename, directory name, or volume label syntax is incorrect.).)
Python:2.6.6
wxPython:2.8.11.0
Windows 7
py2exe: 0.6.9
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import glob
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
'Tkconstants', 'Tkinter']
dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', 'tk84.dll',]#'msvcp90.dll']
packages = []#'wx.lib.pubsub']
data_files = [("resources", ['resources/1187958_90214884.jpg'])]
packages = ['wx.lib.pubsub',]
options = {'py2exe': {'compressed': 3,
'optimize': 2,
'excludes': excludes,
'packages': packages,
'dll_excludes': dll_excludes,
'bundle_files': 1,
'dist_dir': 'dist',
'xref': False,
'skip_archive': False,
'ascii': False,
'packages': packages,
'custom_boot_script': '',
}
}
#windows=[{'script':'gui.py'}]
for script in ["gui.py"]:
windows=[{
'script':[script]
}]
setup(options=options, console=[script], zipfile=None, data_files=data_files)
【问题讨论】: