繁体   English   中英

无法安装 python 的 pyaudio

[英]Not able to install pyaudio of python

当我尝试安装 pyaudio 时发生错误:- 请帮助我

  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
    Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\acer\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-4r2yz81m\\pyaudio_7658f0f23b7e4c5593332ef0c870e763\\setup.py'"'"'; __file__='"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-4r2yz81m\\pyaudio_7658f0f23b7e4c5593332ef0c870e763\\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\acer\AppData\Local\Temp\pip-record-jto6it74\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\acer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\pyaudio'
         cwd: C:\Users\acer\AppData\Local\Temp\pip-install-4r2yz81m\pyaudio_7658f0f23b7e4c5593332ef0c870e763\
    Complete output (9 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    copying src\pyaudio.py -> build\lib.win-amd64-3.9
    running build_ext
    building '_portaudio' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\acer\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-4r2yz81m\\pyaudio_7658f0f23b7e4c5593332ef0c870e763\\setup.py'"'"'; __file__='"'"'C:\\Users\\acer\\AppData\\Local\\Temp\\pip-install-4r2yz81m\\pyaudio_7658f0f23b7e4c5593332ef0c870e763\\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\acer\AppData\Local\Temp\pip-record-jto6it74\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\acer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\pyaudio' Check the logs for full command output.

error: Microsoft Visual C++ 14.0 is required下载视觉 c++ 构建工具: https://visualstudio.microsoft.com/visual-cpp-build-tools

https://pypi.org/project/PyAudio/#files

它显示了 python 2.7、3.4、3.5 和 3.6 的轮子。由于您没有 bdist_wheel并且您使用的是 python 3.9,因此源代码安装已完成。

而且因为 pyaudio 有需要编译的本机代码部分(因为轮子不可用) - 你需要在你的机器上安装工作的 Visual Studio。 正如错误消息所说:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM