简体   繁体   中英

I am not able to install Pyaudio in my windows 10

When I Write pip install pyaudio or -m pip install PyAudio Then it shows an error like bellow -

ERROR: Command errored out with exit status 1:
     command: 'C:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudio\\setup.py'"'"'; __file__='"'"'C
:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();ex
ec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SUDHAN~1\AppData\Local\Temp\pip-record-b0h1w_j0\install-record.txt' --single-version-externally-managed --compile --install-headers
 'C:\python37\Include\PyAudio'
         cwd: C:\Users\SUDHAN~1\AppData\Local\Temp\pip-install-zern0h1s\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": http://landinghub.visualstudio.com/visual-cpp-build-tools
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\PyAudi
o\\setup.py'"'"'; __file__='"'"'C:\\Users\\SUDHAN~1\\AppData\\Local\\Temp\\pip-install-zern0h1s\\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\SUDHAN~1\AppData\Local\Temp\pip-record-b0h1w_j0\install-record.txt' --single-version-externally-ma
naged --compile --install-headers 'C:\python37\Include\PyAudio' Check the logs for full command output.

Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools

You need install MS VS here

As the error says, install Microsoft Visual C++ 14.0 - it provides required build tools. You can download it from here . Also, to avoid majority of such problems in future, make sure you have Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 - install all of them.

Download Visual Studio installer. After the installer is installed, launch it and go to the Workloads tab and select C++ build tools and install them.

在此处输入图片说明

After installing C++ build tools, try installing PyAudio in a new Command Prompt window.

Remember: install PyAudio in a new command prompt window after closing the previous window.

Step 1 : Download the Pyaudio from this website

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

Depending on your python version

Step 2 : then open cmd on the same directory where pyaudio is downloaded

Step 3 : Then type this command: pip install pyaudiofilename

for example

pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl

i hope it will work!

i also tried all of these answers but none of these works!

so i tried this solution and it worked!

Here is the ScreenShot!

Before

在此处输入图片说明

After

在此处输入图片说明

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