使用 pip 构建 pysha3 时出错?错误:pysha3 构建轮子失败

2024-04-16

当我尝试使用 pip install pysha3 进行安装时,出现错误“错误:无法为 pysha3 构建轮子”。我已经安装了 Windows 构建工具。不幸的是我在谷歌上找不到太多帮助。我使用的是 Windows 11。

这是日志

`

PS C:\Users\Alexis> pip3 install pysha3
Collecting pysha3
  Using cached pysha3-1.0.2.tar.gz (829 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pysha3
  Building wheel for pysha3 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      copying sha3.py -> build\lib.win-amd64-cpython-311
      running build_ext
      building '_pysha3' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\Modules
      creating build\temp.win-amd64-cpython-311\Release\Modules\_sha3
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_WITH_KECCAK=1 -IC:\Python311\include -IC:\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /TcModules/_sha3/sha3module.c /Fobuild\temp.win-amd64-cpython-311\Release\Modules/_sha3/sha3module.obj
      sha3module.c
      C:\Users\Alexis\AppData\Local\Temp\pip-install-78ji94vk\pysha3_9e9c90f2f01445aeb1ab3ed6a6c14e42\Modules\_sha3\backport.inc(78): fatal error C1083: Cannot open include file: 'pystrhex.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pysha3
  Running setup.py clean for pysha3
Failed to build pysha3
Installing collected packages: pysha3
  Running setup.py install for pysha3 ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pysha3 did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      running install
      C:\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      copying sha3.py -> build\lib.win-amd64-cpython-311
      running build_ext
      building '_pysha3' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\Modules
      creating build\temp.win-amd64-cpython-311\Release\Modules\_sha3
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_WITH_KECCAK=1 -IC:\Python311\include -IC:\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /TcModules/_sha3/sha3module.c /Fobuild\temp.win-amd64-cpython-311\Release\Modules/_sha3/sha3module.obj
      sha3module.c
      C:\Users\Alexis\AppData\Local\Temp\pip-install-78ji94vk\pysha3_9e9c90f2f01445aeb1ab3ed6a6c14e42\Modules\_sha3\backport.inc(78): fatal error C1083: Cannot open include file: 'pystrhex.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pysha3

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

`

我确实安装了 C++ 的 Windows 构建工具


遇到同样的问题,上次我可能通过切换到 Python 3.8.7 来解决它。但现在我安装了 3.11,但 pysha3 又没有安装。 (10号窗口)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 pip 构建 pysha3 时出错?错误:pysha3 构建轮子失败 的相关文章

随机推荐