使用 Python 3.5 和 cx_freeze 5.0.1
**MY Folder Structure :**
Main_file.py,
Log.py,
ExcelOperations.Py,
TestData.xlsx,
Config.ini,
PsExec.exe (For remote execution)
我正在尝试为 Main_file.py 创建单个 .exe 文件,该文件是使用 [Log.py,ExcelOperations.Py 和 OS, subprocess,configparser 导入 Main_file.py 文件]
我的 Setup.py 文件
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
base = None
setup( name = "guifoo",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("Main_file.py", base=base)])
# 使用上面的安装文件创建构建后,我的 Main_file.exe 文件没有按预期工作 [它只是在一毫秒内启动并关闭 cmd]
请让我知道我做错了什么?
看起来 cx_freeze 没有收集 xlwt 包所需的所有模块。尝试编辑您的build_exe_options
变量以包含 xlwt 包
build_exe_options = {"packages": ["os", "xlwt"], "excludes": ["tkinter"]}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句