Error installing Pyaudio

Asked

Viewed 3,533 times

-2

I installed Pocketsphinx all right, along with Visual C++ Tools, but when installing Pyaudio, it presents the following error:

 Failed to build pyaudio Installing collected packages: pyaudio   Running setup.py install for pyaudio ... error
    Complete output from command c:\users\mykga\appdata\local\programs\python\python37-32\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\mykga\\AppData\\Local\\Temp\\pip-install-uyaqu8fp\\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\mykga\AppData\Local\Temp\pip-record-zubrtcib\install-record.txt
--single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    copying src\pyaudio.py -> build\lib.win32-3.7
    running build_ext
    building '_portaudio' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD
-Ic:\users\mykga\appdata\local\programs\python\python37-32\include -Ic:\users\mykga\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
    _portaudiomodule.c
    src/_portaudiomodule.c(29): fatal error C1083: NÆo ‚ poss¡vel abrir arquivo incluir: 'portaudio.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

----------------------------------------

 Command
 "c:\users\mykga\appdata\local\programs\python\python37-32\python.exe
 -u -c "import setuptools, tokenize;__file__='C:\\Users\\mykga\\AppData\\Local\\Temp\\pip-install-uyaqu8fp\\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\mykga\AppData\Local\Temp\pip-record-zubrtcib\install-record.txt
 --single-version-externally-managed --compile" failed with error code 1 in C:\Users\mykga\AppData\Local\Temp\pip-install-uyaqu8fp\pyaudio\

There’s something I can do?

2 answers

2

Pyaudio does not support Python 3.7+, however it is possible to install the package for newer versions through pipwin. Run the code below on your terminal:

$ pip install pipwin
$ pipwin install pyaudio

-4

pip install pipwin

pipwin install pyaudio

Browser other questions tagged

You are not signed in. Login or sign up in order to post.