python 安装包时 ERROR: Failed building wheel for webrtcvad

发布时间 2023-10-29 16:44:45作者: 起床看书

报错信息:

error: subprocess-exited-with-error

× Building wheel for webrtcvad (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
copying webrtcvad.py -> build\lib.win-amd64-cpython-310
running build_ext
building '_webrtcvad' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for webrtcvad

解决方法:

官方的回答 


Microsoft Visual C++ 14.x with Visual Studio 2022 (x86, x64, ARM, ARM64)
Install Microsoft Visual Studio 2022 (or later).

Install the Python development workload and the optional Python native development tools option.

Install the latest Windows SDK (under Native development in the installer).

Optional: Set $env:PlatformToolset to your toolset version before building, if it doesn't detect it.

Update to the latest setuptools Python package version.

For additional details, please have a look at the Windows section of the Python Development Guide and the PCbuild/python.props file for full details on how Python is built on Windows.

At the time of this writing, CPython is built using VC++ 14.3 (Jan 2022).

翻译:
带有Visual Studio 2022的Microsoft Visual C ++ 14.x (x86、x64、ARM、ARM64)
安装Microsoft Visual Studio 2022 (或更高版本)。

安装Python开发工作负载和可选的Python本机开发工具选项。

安装最新的Windows SDK (在安装程序中的本机开发下)。

可选: 在构建之前将 $ env:PlatformToolset设置为您的工具集版本,如果它没有检测到它。

更新到最新的setuptools Python软件包版本。

有关更多详细信息,请查看Python开发指南的Windows部分以及PCbuild/python.props文件,以获取有关如何在Windows上构建Python的完整详细信息。

在撰写本文时,CPython是使用VC ++ 14.3 (2022年1月) 构建的。