Pip install pyaudio error

Environment pip version: 20.2.1 Python version: 3.8.5 OS: Microsoft Windows 10 I wanted to download kivy some days ago but I stuck with the same problem there as I am here with PyAudio now. I wante...

Environment

  • pip version: 20.2.1
  • Python version: 3.8.5
  • OS: Microsoft Windows 10

I wanted to download kivy some days ago but I stuck with the same problem there as I am here with PyAudio now. I wanted to do the Audio Recognizer with speech_recognition. But the error says that PyAudio is required as well and its not installed. I tried to installed PyAudio too but I got the same pip install error (below). And I have the same thing when I am trying to download Kivy module too. Could you help me? Thanks.

C:Windowssystem32>pip install PyAudio
Collecting PyAudio
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: PyAudio
  Building wheel for PyAudio (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'd:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"'; __file__='"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:temppip-wheel-bmt3h4eq'
       cwd: C:temppip-install-6pli5j0vpyaudio
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win32-3.8
  copying srcpyaudio.py -> buildlib.win32-3.8
  running build_ext
  building '_portaudio' extension
  creating buildtemp.win32-3.8
  creating buildtemp.win32-3.8Release
  creating buildtemp.win32-3.8Releasesrc
  C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.26.28801binHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:pythoninclude -Id:pythoninclude "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.26.28801include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum" /Tcsrc/_portaudiomodule.c /Fobuildtemp.win32-3.8Releasesrc/_portaudiomodule.obj
  _portaudiomodule.c
  src/_portaudiomodule.c(27): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: stdio.h: No such file or directory,
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for PyAudio
  Running setup.py clean for PyAudio
Failed to build PyAudio
DEPRECATION: Could not build wheels for PyAudio which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: PyAudio
    Running setup.py install for PyAudio ... error
    ERROR: Command errored out with exit status 1:
     command: 'd:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"'; __file__='"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:temppip-record-vzlk5_oninstall-record.txt' --single-version-externally-managed --compile --install-headers 'd:pythonIncludePyAudio'
         cwd: C:temppip-install-6pli5j0vpyaudio
    Complete output (15 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win32-3.8
    copying srcpyaudio.py -> buildlib.win32-3.8
    running build_ext
    building '_portaudio' extension
    creating buildtemp.win32-3.8
    creating buildtemp.win32-3.8Release
    creating buildtemp.win32-3.8Releasesrc
    C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.26.28801binHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:pythoninclude -Id:pythoninclude "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.26.28801include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum" /Tcsrc/_portaudiomodule.c /Fobuildtemp.win32-3.8Releasesrc/_portaudiomodule.obj
    _portaudiomodule.c
    src/_portaudiomodule.c(27): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: stdio.h: No such file or directory,
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:pythonpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"'; __file__='"'"'C:\temp\pip-install-6pli5j0v\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:temppip-record-vzlk5_oninstall-record.txt' --single-version-externally-managed --compile --install-headers 'd:pythonIncludePyAudio' Check the logs for full command output.

Learn how install properly PyAudio in Ubuntu 18.04 and prevent this exception from appearing.

Usually, you will be able to install PyAudio with PIP using the following command:

pip install PyAudio

Pitifully, in some distributions of Ubuntu, you will face an exception about a failure when building the wheel for pyaudio. According to the Python Packaging Index’s description, a wheel *is designed to contain all the files for a PEP 376 compatible install in a way that is very close to the on-disk format.

The error output when you try to install the package will be:

pip install pyaudio
Failed building wheel for pyaudio
  Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    Complete output from command /Users/kj/Desktop/ml/gui/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/vd/8zl261fj35j8pst5659glmjc0000gn/T/pip-build-gj9ny3f9/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/vd/8zl261fj35j8pst5659glmjc0000gn/T/pip-45sl0b3v-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/kj/Desktop/ml/gui/include/site/python3.6/pyaudio:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.12-x86_64-3.6
    copying src/pyaudio.py -> build/lib.macosx-10.12-x86_64-3.6
    running build_ext
    building '_portaudio' extension
    creating build/temp.macosx-10.12-x86_64-3.6
    creating build/temp.macosx-10.12-x86_64-3.6/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMACOSX=1 -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/Users/kj/Desktop/ml/gui/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.12-x86_64-3.6/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

The error is basically caused by the missing portaudio.h file in the system. PortAudio is a free, cross-platform, open-source, audio I/O library.

Solution

You can fix this exception installing the dev portaudio package and pyaudio with the following command in Ubuntu:

sudo apt-get install portaudio19-dev python-pyaudio

Finally install the package again with the command:

pip install PyAudio

And you should be able to install it properly without an issue !

Happy coding !

I wanted to install pyaduio but it spits out this error. Dont know what to do, please help me

D:PythonTestT>pip install PyAudio
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:usersjtuleappdatalocalprogramspythonpython38-32python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\jtule\AppData\Local\Temp\pip-install-voea64si\pyaudio\setup.py'"'"'; __file__='"'"'C:\Users\jtule\AppData\Local\Temp\pip-install-voea64si\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersjtuleAppDataLocalTemppip-record-2m62m3jkinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersjtuleappdatalocalprogramspythonpython38-32IncludePyAudio'
         cwd: C:UsersjtuleAppDataLocalTemppip-install-voea64sipyaudio
    Complete output (15 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win32-3.8
    copying srcpyaudio.py -> buildlib.win32-3.8
    running build_ext
    building '_portaudio' extension
    creating buildtemp.win32-3.8
    creating buildtemp.win32-3.8Release
    creating buildtemp.win32-3.8Releasesrc
    C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110binHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:usersjtuleappdatalocalprogramspythonpython38-32include -Ic:usersjtuleappdatalocalprogramspythonpython38-32include "-IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuildtemp.win32-3.8Releasesrc/_portaudiomodule.obj
    _portaudiomodule.c
    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\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersjtuleappdatalocalprogramspythonpython38-32python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\jtule\AppData\Local\Temp\pip-install-voea64si\pyaudio\setup.py'"'"'; __file__='"'"'C:\Users\jtule\AppData\Local\Temp\pip-install-voea64si\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersjtuleAppDataLocalTemppip-record-2m62m3jkinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersjtuleappdatalocalprogramspythonpython38-32IncludePyAudio' Check the logs for full command output.

Понравилась статья? Поделить с друзьями:
  • Pip install psutil error
  • Pip install protocol error
  • Pinnacle ошибка 1003
  • Pip install numba ошибка
  • Pinnacle studio неверный адрес электронной почты код ошибки 20002