使用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,子进程,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文件无法按预期工作[它只是在mili sec中启动和关闭cmd]
请告诉我在这方面我做错了什么?
答案 0 :(得分:0)
看起来cx_freeze没有收集xlwt包的所有必需模块。尝试编辑build_exe_options
变量以包含xlwt包
build_exe_options = {"packages": ["os", "xlwt"], "excludes": ["tkinter"]}