如何安装pyaudio 083546

时间:2019-09-11 14:53:05

标签: pyaudio

安装pyaudio时出现错误

我已经下载了portaudio,但是我不确定该放在哪里。我正在尝试创建一个SpeechRecognition程序,如果没有Speechrecognition,该程序将无法正常工作。

发生以下错误:

C:\Users\lenovo>pip install pyaudio
Collecting pyaudio
  Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lenovo\AppData\Local\Temp\pip-record-ckrughg6\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-w_ldd4wb\pyaudio\
    Complete output (9 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    copying src\pyaudio.py -> build\lib.win-amd64-3.7
    running build_ext
    building '_portaudio' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lenovo\AppData\Local\Temp\pip-record-ckrughg6\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

1 个答案:

答案 0 :(得分:0)

stacktrace的最后一行包含错误:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

可以通过从以下位置安装建议的工具来修复此错误: https://visualstudio.microsoft.com/visual-cpp-build-tools/