gpt4 book ai didi

python - cx_freeze 无法导入 numpy

转载 作者:行者123 更新时间:2023-12-01 17:26:06 26 4
gpt4 key购买 nike

我的主 py 文件工作正常,但是当我用 cx_freeze 卡住它并尝试打开时,它发生错误并且无法打开。它说: enter image description here

这是我的 setup.py :

import os
from cx_Freeze import setup, Executable
build_exe_options = {"packages":["lxml","gzip","requests"]}

setup( name = "name",
version = "0.1",
description = "description",
options = {"build_exe": build_exe_options},
executables = [Executable("file.py", icon=os.path.join("icon_64x64.ico"), base="Win32GUI")])

..

最佳答案

这对我有用 python 3.6:

build_exe_options = {"packages": ["os", "numpy"], "includes": ["numpy"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"

setup(name="Hello World",
version="0.1",
description="My GUI application!",
options={"build_exe": build_exe_options},
executables=[Executable("main.py", base=base)])

关于python - cx_freeze 无法导入 numpy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41884980/

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