-3

I get the following ERROR while installing pyaudio

C:\Users\Admin\Downloads>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: Complete output from command 'c:\users\admin\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-snth_fqh\\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\Admin\AppData\Local\Temp\pip-record-3n7dvpm8\install-record.txt' --single-version-externally-managed --compile:
    ERROR: 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 "'c:\users\admin\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-snth_fqh\\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\Admin\AppData\Local\Temp\pip-record-3n7dvpm8\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-snth_fqh\pyaudio\
Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
  • 1
    What did you not understand from the error output? `extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ` Also take this StackOverflow Tour https://stackoverflow.com/tour – Rahul May 30 '19 at 17:59
  • See answer https://stackoverflow.com/a/52284344/4777984 – tgikal May 30 '19 at 18:01
  • error is self explanatory – Muhammad Naufil May 30 '19 at 18:39

2 Answers2

1

You are missing Visual C++ from your computer. Download and install from here: https://www.microsoft.com/en-us/download/details.aspx?id=48145

and then re run the install for PyAudio.

Anurag Saxena
  • 388
  • 2
  • 7
0

Visual Studio changed the Build Tools from being C++ specific in late 2017. Thus newer Visual Studio versions work in place of older versions.

You can install it using:

1.https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16 2.https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019

Windows Python needs Visual C++ libraries installed via the SDK to build code.

toshiro92
  • 1,287
  • 5
  • 28
  • 42
SuvojitBarick
  • 11
  • 1
  • 3