5

我在将东西包含到我的 cx_Freeze 脚本中时遇到了这个问题,我试图做的是包含 easygui 和 sys,因为我在我的程序中使用它们。任何帮助,将不胜感激!

继承人的代码:

import sys
from cx_Freeze import setup, Executable


build_exe_options = {"packages": ["os"], "excludes": ["tkinter"] }


base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(  name = "ProgramGUI",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("ProgramGUI.py", base=base)])

所以我真正需要知道的就是如何将 Includes[“sys”,“easyGUI”] 合并到设置脚本中:D

4

1 回答 1

4

说真的,我认为您只是错过了告诉 cx_freeze 导入 easy_gui 的小事:

import sys
from cx_Freeze import setup, Executable


build_exe_options = {
    "packages": ["os", "sys"], 
    "excludes": ["tkinter"],
    "includes": ["easy_gui"] # <-- Include easy_gui
}

base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(  name = "ProgramGUI",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("ProgramGUI.py", base=base)])
于 2016-07-14T09:54:12.510 回答