我從編譯輸出/日誌,使之成爲一個評論,但我沒有信譽尚未...
任何警告/錯誤?
什麼時候在命令提示符下運行可執行文件?
您的可執行文件需要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,會發生什麼情況? –