4

After doing pip install pyaudio, It started collecting the package but suddenly it displayed this error. Hope the following explains what's going on:

Collecting pyaudio
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Installing collected packages: pyaudio
    Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio'
         cwd: C:\Users\mayank\AppData\Local\Temp\pip-install-b1kw0ltr\pyaudio\

Complete output (15 lines):

    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    copying src\pyaudio.py -> build\lib.win32-3.8
    running build_ext
    building '_portaudio' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
    _portaudiomodule.c
    src/_portaudiomodule.c(27): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio' Check the logs for full command output.
8

5 Answers 5

19
brew install portaudio

Then:

brew link portaudio

pip install pyAudio

Or if you are using windows:

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

Download the file and then go to its directory in the cmd and type:

For win 32 bit:

pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl

For win 64 bit:

pip install PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl
Sign up to request clarification or add additional context in comments.

6 Comments

Are you using windows? I added another way to my solution, which one did not work for you?
ERROR: PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl is not a valid wheel filename........this error comes out
If you are using win 64 please download 64 ones
For example: PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl
ERROR: PyAudio-0.2.11-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
|
2

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

press ctrl + f and search pyaudio and scroll down

Download any version of this if you are using 64 bit-

PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl

or download any version of this if you are using 32 bit -

PyAudio‑0.2.11‑cp39‑cp39‑win32.whl

go to the file location of the downloaded file and press Shift + Right click

select open command window here then copy the file name and paste like pip install "file name" for e.g-

pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl

Comments

2

If you are working on Ubunutu/Linux try below. It worked for me

sudo apt-get install portaudio19-dev
pip install pyaudio

Comments

0

You have to download the pyAudio file manually and put it in a directory and cd to the same directory and run the given command.

enter image description here

1 Comment

Welcome to SO! It is highly recommended to post text information as text not images.
0

I had the same issue and fixed it using pipwin:

pip install pipwin
pipwin install pyaudio

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.