在使用 pip install pyHook3 安装 PyHook3 时,您可能会遇到如下错误信息:

C:\Windows\system32>pip install pyHook3
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting pyHook3
  Downloading https://pypi.doubanio.com/packages/d2/e9/01e84a297a83e826978ca917e9ee538b86924c6235b656f3cc81950cda44/PyHook3-1.6.1.tar.gz (12 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyHook3
  Building wheel for pyHook3 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\PyHook3
      copying aa hook.py -> build\lib.win-amd64-cpython-310\PyHook3
      copying cpyHook.py -> build\lib.win-amd64-cpython-310\PyHook3
      copying doc.py -> build\lib.win-amd64-cpython-310\PyHook3
      copying example.py -> build\lib.win-amd64-cpython-310\PyHook3
      copying HookManager.py -> build\lib.win-amd64-cpython-310\PyHook3
      copying __init__.py -> build\lib.win-amd64-cpython-310\PyHook3
      running build_ext
      building 'PyHook3._cpyHook' extension
      swigging cpyHook.i to cpyHook_wrap.c
      swig.exe -python -o cpyHook_wrap.c cpyHook.i
      error: command 'swig.exe' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyHook3
  Running setup.py clean for pyHook3
Failed to build pyHook3
ERROR: Could not build wheels for pyHook3, which is required to install pyproject.toml-based projects

这个错误可能是由于缺少 SWIG 或 SWIG 没有正确安装。SWIG 是一个生成 C/C++ 与 Python 语言之间接口的工具,pyHook3 使用 SWIG 生成其 Python 接口。请尝试安装 SWIG 并再次安装 pyHook3。您可以在 SWIG 官方网站(http://www.swig.org/download.html)上找到 SWIG 的下载和安装指南。

解决 Python PyHook3 安装失败问题:缺少 SWIG 或 SWIG 安装错误

原文地址: https://www.cveoy.top/t/topic/oxZL 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录