我在使用cx_Freeze-5.0.1-cp36-cp36m-win32.whl
编译python 3.6到exe时遇到问题,请帮帮我。
我已经从http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
然后我启动cmd并运行此命令:
python setup.py build
setup.py
文件如下:
import sys
from cx_Freeze import setup, Executable
setup(
name = "Check Telemetry",
version = "0.1",
description = "Check Telemetry",
executables = [Executable("excel_to_sqlite_xlrd-light.py", base = "console")])
然后我有这样的事情:
但如果我运行我的.exe文件,我有以下问题:
屏幕截图显示以下错误:
你有什么想法吗? 谢谢!
答案 0 :(得分:1)
似乎程序没有找到依赖项,所以添加它(你必须添加缺少的依赖项(在这个例子中我把os):
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
然后:
setup( name = "Check Telemetry",
version = "0.1",
description = "Check Telemetry",
options = {"build_exe": build_exe_options},
executables = [Executable("excel_to_sqlite_xlrd-light.py", base = "console")])