I'm trying to install pyaudio with pip3 install pyaudio in Ubuntu Mate. But I get an error. How to fix the error?
Collecting pyaudio Downloading
Building wheels for collected packages: pyaudio Running setup.py bdist_wheel for pyaudio ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sdstw2l2/pyaudio/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/tmpxh6_2az5pip-wheel- --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-i686-3.6 copying src/pyaudio.py -> build/lib.linux-i686-3.6 running build_ext building '_portaudio' extension creating build/temp.linux-i686-3.6 creating build/temp.linux-i686-3.6/src i686-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/usr/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-i686-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory #include "portaudio.h" ^~~~~~~~~~~~~ compilation terminated. error: command 'i686-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- 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 /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sdstw2l2/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 /tmp/pip-tccnyizi-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_py creating build creating build/lib.linux-i686-3.6 copying src/pyaudio.py -> build/lib.linux-i686-3.6 running build_ext building '_portaudio' extension creating build/temp.linux-i686-3.6 creating build/temp.linux-i686-3.6/src i686-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/usr/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-i686-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory #include "portaudio.h" ^~~~~~~~~~~~~ compilation terminated. error: command 'i686-linux-gnu-gcc' failed with exit status 1 ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sdstw2l2/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 /tmp/pip-tccnyizi-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-sdstw2l2/pyaudio/ 1 1 Answer
from
sudo apt-get install portaudio19-dev
pip3 install pyaudio