我从编译输出/日志,使之成为一个评论,但我没有信誉尚未...
任何警告/错误?
什么时候在命令提示符下运行可执行文件?
您的可执行文件需要cx_freeze未找到的库吗?
你可能会需要像指定库包含额外的选项... 调整在cx_freeze documentation您可以指定的例子包括使用TKinter:
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"includes": ["tkinter"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "simple_Tkinter",
version = "0.1",
description = "Sample cx_Freeze Tkinter script",
options = {"build_exe": build_exe_options},
executables = [Executable("the timer.py", base = base)])
setup( name = "guifoo",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("guifoo.py", base=base)])
我知道我有很多有趣的问题让py2exe与PySide/PyQt4,matplotlib,numpy等一起工作。一些模块,比如matplotlib,甚至提供了一个方法来列出构建/分发应用程序所需的所有数据文件(matplotlib.get_py2exe_datafiles())。 Enthought Traits的解决方案UI利用glob来获取所需文件的目录。我的观点是,因为某些库中的模块导入可能是动态的,杂乱的或黑魔法的,所以许多构建实用程序无法找到所有必需的资源。此外,一旦你的可执行文件正在工作,如果你发现你的应用程序不需要的发行版中的东西,你可以用其他选项排除它,这有助于减少发行版中的膨胀。希望TKinter不会太难以工作 - 看起来StackOverflow上的其他人是成功的。
对不起,我没有坚如磐石的解决方案,但我正在尽力帮助!祝你好运!
如果您在命令提示符下运行该exe,会发生什么情况? –