0

I'm trying to pip install PyAudio in a venv to use it in tandem with the SpeechRecognition module. Any chance you know a quick fix to my error message?

ERROR: Command errored out with exit status 1

Or is this a deeper problem? And feel free to let me know if this is a stupid question! By the way, I've tried pip install PyAudio in my cmd as administrator, too. Same error. And I'm not too keen on downloading an older version of Python (I'm using 3.9.0) as some would suggest.

Here's my full error message, if that helps (I'm not sure what to look at, but you might):

Collecting 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\Ethan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ethan\\AppData\\Local\\Temp\\pip-install-aydn66pc\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ethan\\AppData\\Local\\Temp\\pip-install-aydn66pc\\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\Ethan\AppData\Local\Temp\pip-record-otzyi04l\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\pyaudio'
         cwd: C:\Users\Ethan\AppData\Local\Temp\pip-install-aydn66pc\pyaudio\
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    copying src\pyaudio.py -> build\lib.win-amd64-3.8
    running build_ext
    building '_portaudio' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.8\Release\src/_portaudiomodule.obj
    _portaudiomodule.c
    C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
    src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
    src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Ethan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ethan\\AppData\\Local\\Temp\\pip-install-aydn66pc\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ethan\\AppData\\Local\\Temp\\pip-install-aydn66pc\\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\Ethan\AppData\Local\Temp\pip-record-otzyi04l\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\pyaudio' Check the logs for full command output.

Thanks!

Ethan
  • 1
  • 1
  • The `ERROR` line says (at the end): _Check the logs for full command output_. What do the logs say? – Adrian W Oct 15 '20 at 22:02
  • The important part of the error message is "Cannot open include file: 'portaudio.h': No such file or directory". I suggest googling this to see if you can find a solution. – Code-Apprentice Oct 15 '20 at 22:04
  • Does this answer your question? [portaudio.h: No such file or directory](https://stackoverflow.com/questions/48690984/portaudio-h-no-such-file-or-directory) – Code-Apprentice Oct 15 '20 at 22:04
  • So it seems like pyaudio doesnt support newer versions of python - https://stackoverflow.com/questions/52283840/i-cant-install-pyaudio-on-windows-how-to-solve-error-microsoft-visual-c-14 – Craicerjack Oct 15 '20 at 22:12
  • Yup - checking on the pyaudio site - https://people.csail.mit.edu/hubert/pyaudio/ - it only supports up to python 3.6 – Craicerjack Oct 15 '20 at 22:13
  • @Code-Apprentice hes on windows not ubuntu – Craicerjack Oct 15 '20 at 22:15

0 Answers0