【发布时间】:2017-05-28 00:43:43
【问题描述】:
使用 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 文件没有按预期工作 [它只是在几毫秒内启动并关闭 cmd]
请让我知道我在这方面做错了什么?
【问题讨论】:
-
你试过通过命令提示符启动 exe 吗?
-
是的,我已经尝试过,但遇到了导入错误。文件“C:\Users\administrator\AppData\Local\Programs\Python\Python35\lib\s te-packages\xlwt-1.2.0-py3.5.egg\xlwt\ExcelFormula.py”第 3 行,在模块> 从 .导入 ExcelFormulaParser,ExcelFormulaLexer 导入错误:无法导入名称“ExcelFormulaParser”
-
我会把它包括在问题中
标签: python python-3.x cx-freeze