gpt4 book ai didi

python - cx_Freeze : Python error in main script. Python 3.6 + cx_Freeze

转载 作者:太空宇宙 更新时间:2023-11-03 15:24:37 24 4
gpt4 key购买 nike

我在使用 cx_Freeze-5.0.1-cp36-cp36m-win32.whl 将 python 3.6 编译为 exe 时遇到问题,请帮助我。

我已经从http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze安装了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")])

然后我有这样的东西: enter image description here

但是如果我运行我的 .exe 文件,我会遇到以下问题: enter image description here

以下有错误的行的屏幕截图: enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

你有什么想法吗?谢谢!

最佳答案

似乎程序没有找到依赖项,所以添加这个(你必须添加缺少的依赖项(在这个例子中我输入了操作系统):

    # 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")])

关于python - cx_Freeze : Python error in main script. Python 3.6 + cx_Freeze,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43250326/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com