gpt4 book ai didi

python - cx_freeze 不适用于 pyHooks

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

我是 cx_Freeze 的新手,但是当我尝试使用 pyHooks 时,它不起作用。这是我的 setup.py 代码:

from cx_Freeze import setup, Executable

includes=["re", "pyHook"]

exe = Executable(
script="hello.py",
base="Win32Gui",
targetName = "hello.exe"
)

setup(
name = "hello",
version = "1",
description = "description",
options = {"build_exe": {"includes":includes}},
executables = [exe]
)

当我运行 exe 文件时,错误显示:

ImportError: 无法导入名称 cpyHook

最佳答案

好的,一种解决方法是手动包含 cpyHook.py .

options = {"build_exe": {"includes":includes, 'include_files': ['cpyHook.py']}},

可以得到cpyHook.py<python install dir>\Lib\site-packages\pyHook\

关于python - cx_freeze 不适用于 pyHooks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19330525/

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