issues installing pyaudio on pycharm

i tried installing pyaudio in my pycharm ide and got the below error message, can someone help me out, thanks:

(venv) C:\Users\chris\PycharmProjects\speachrecog>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
Complete output from command C:\Users\chris\PycharmProjects\speachrecog\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\chris\\AppData\\Local\\Temp\\p
ip-install-58ncljxe\\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\chris\AppData\Local\Temp\pip-record-5221_bkn\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\chris\PycharmProjects\speachrecog\venv\i
nclude\site\python3.8\pyaudio:
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 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\chris\PycharmProjects\speachrecog\venv\include -IC:\Users\chris\AppDa
ta\Local\Programs\Python\Python38-32\include -IC:\Users\chris\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\P
rogram Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Prog
ram Files (x86)\Windows Kits\8.1\include\winrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_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 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

7 comments
Comment actions Permalink

Hello, 

 

Please follow this troubleshooting guide https://intellij-support.jetbrains.com/hc/en-us/articles/360010202240 and let me know the results as described in "Reporting to PyCharm issue tracker" topic. 

-1
Comment actions Permalink

exact same problem here

1
Comment actions Permalink

same problem for me.

0
Comment actions Permalink

Hi everyone,

I would like to highlight the fact that the issue is not IDE-related. 

To troubleshoot, you should make sure that C++ build tools are installed: https://visualstudio.microsoft.com/visual-cpp-build-tools/

And if the issue persists, it's worth trying to google the error.

0
Comment actions Permalink

Hey, I resolved this issue myself with abit of googling and possibly luck, firstly as Andrey said make sure you have c++ tools installed , then install pipwin from the terminal "pip install pipwin".
Then do pipwin install pyaudio , it make ask you to download a few other dependencies but they should install with no issues.

2
Comment actions Permalink

I solved mine too the same way with pipwin.

0
Comment actions Permalink

um i tried all the methods like pip install PyAudio or pipwin install PyAudio but it dosen't work can anyone plz give the right solotion cause IDK how to install pyaudio and also this error comes when i used the command 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: /home/10666854/Downloads/borish/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-e6vhrc87
cwd: /tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying src/pyaudio.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/10666854/Downloads/borish/python/include -I/usr/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: /home/10666854/Downloads/borish/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-k92v8_p9/install-record.txt --single-version-externally-managed --compile --install-headers /home/10666854/Downloads/borish/python/include/site/python3.6/pyaudio
cwd: /tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying src/pyaudio.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/10666854/Downloads/borish/python/include -I/usr/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/10666854/Downloads/borish/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-znea394c/pyaudio_63a7fb1fe75e462b9f4a620692ad6d6c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-k92v8_p9/install-record.txt --single-version-externally-managed --compile --install-headers /home/10666854/Downloads/borish/python/include/site/python3.6/pyaudio Check the logs for full command output.
------------------------------------------------------------------------------------------------

And when i try pipwin install pyaudio this comes
------------------------------------------------------------------------------------------------

: UserWarning: Found a non Windows system. Package installation might not work.
warn("Found a non Windows system. Package installation might not work.")
Package `pyaudio` found in cache
Downloading package . . .
https://download.lfd.uci.edu/pythonlibs/z4tqcw5k/cp36/PyAudio-0.2.11-cp36-cp36m-win_amd64.whl
PyAudio-0.2.11-cp36-cp36m-win_amd64.whl
File /home/10666854/pipwin/PyAudio-0.2.11-cp36-cp36m-win_amd64.whl already exists
ERROR: PyAudio-0.2.11-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
Traceback (most recent call last):
File "/home/10666854/Downloads/borish/python/bin/pipwin", line 8, in <module>
sys.exit(main())
File "/home/10666854/Downloads/borish/python/lib/python3.6/site-packages/pipwin/command.py", line 98, in main
cache.install(package)
File "/home/10666854/Downloads/borish/python/lib/python3.6/site-packages/pipwin/pipwin.py", line 301, in install
subprocess.check_call([executable, "-m", "pip", "install", wheel_file])
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/10666854/Downloads/borish/python/bin/python', '-m', 'pip', 'install', '/home/10666854/pipwin/PyAudio-0.2.11-cp36-cp36m-win_amd64.whl']' returned non-zero exit status 1.

0

Please sign in to leave a comment.