简体   繁体   中英

Not able to install pyaudio of python

when I am trying to install pyaudio an error occurs that is this:- please help me

  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 download visual c++ build tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/

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

It shows wheels for python 2.7, 3.4, 3.5 & 3.6.. And since you do not have bdist_wheel AND you are on python 3.9, source installation is done.

And because pyaudio has native code parts that need to be compiled (because wheel is not available) - you need to have working Visual Studio installed on your machine. Exactly as ther error message says:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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