我会发表评论,但我还没有声誉…
编译输出/日志中是否有任何警告/错误?
在命令提示符下运行可执行文件时有什么反应吗?
您的可执行文件是否需要cx_freeze找不到的库?
您可能需要指定其他选项,例如包含的库…在cx_freeze文档中调整示例,您可以指定包含TKinter:
import sysfrom 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 = Noneif 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的TraitsUI解决方案利用glob来获取所需文件的目录。我的观点是,由于模块导入在某些库中可能是动态的,混乱的或混乱的,因此许多构建实用程序无法找到所有必需的资源。另外,一旦可执行文件正常工作,如果您在发行版中找到不需要的应用程序,则可以使用其他选项将其排除,这有助于减少发行版中的膨胀。希望TKinter不会太辛苦地工作-
看来上的其他人都成功了。
对不起,我没有坚如磐石的解决方案,但我想尽一切可能提供帮助!祝好运!



