python语音识别无法安装



我已经累了安装python语音识别很长一段时间,但得到同样的问题在运行

pip install pyaudio

输出:

Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.10
copying srcpyaudio.py -> buildlib.win-amd64-3.10
running build_ext
building '_portaudio' 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 pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
error: subprocess-exited-with-error

× Running setup.py install for pyaudio did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.10
copying srcpyaudio.py -> buildlib.win-amd64-3.10
running build_ext
building '_portaudio' 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: legacy-install-failure
× Encountered error while trying to install package.
╰─> pyaudio
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

我的理解是:

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/

我必须安装"Microsoft Visual c++ 14.0或更高版本",所以我安装了。但是,即使在
that之后,结果也是一样的!我该怎么办呢?

你可以试试这个

pip install pipwin
then
pipwin install pyaudio

这不仅仅是你的问题,每个人都面临这个问题。

这里有一个修复方法,我希望对你有用:

pip install pipwin

pipwin install pyaudio

通过pipwin安装pyaudio,有时命令不工作,所以尝试

pipwin refresh并再次运行pipwin install pyaudio

如果以上步骤不起作用,请尝试进入Python Packages并安装系统特定版本的pyaudio。

然后在安装包的目录中打开CMD实例并运行pip install package

将'package'替换为您下载的文件名。

相关内容

  • 没有找到相关文章

最新更新