Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active March 28, 2024 21:33
Show Gist options
  • Star 31 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save diegopacheco/d5d4507988eff995da297344751b095e to your computer and use it in GitHub Desktop.
Save diegopacheco/d5d4507988eff995da297344751b095e to your computer and use it in GitHub Desktop.
How to Install pyaudio ubuntu 16.04 LTS?
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
sudo apt-get install ffmpeg libav-tools
sudo pip install pyaudio
@master142
Copy link

I am getting some errors

ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-uriccz5b/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-record-0zx7264w/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
copying src/pyaudio.py -> build/lib.linux-x86_64-3.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.7m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
29 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-uriccz5b/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-record-0zx7264w/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-uriccz5b/pyaudio/

NOTE1: I am using fedora
NOTE2: Instead of apt-get I am using dnf

@viewDOTport
Copy link

i love u

@vineet-codes256
Copy link

vineet-codes256 commented Jan 5, 2022

How to install pyaudio in VS-code?

@vladimiregorov74
Copy link

Этот способ подходит для python 3.10
Для python 3.11 выдает ошибку

@nivaangupta
Copy link

I tried everything this whole thread has suggested
still getting the exact samew error:

error: subprocess-exited-with-error

× Building wheel for pyaudio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-312
creating build/lib.linux-x86_64-cpython-312/pyaudio
copying src/pyaudio/init.py -> build/lib.linux-x86_64-cpython-312/pyaudio
running build_ext
building 'pyaudio._portaudio' extension
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/src
creating build/temp.linux-x86_64-cpython-312/src/pyaudio
gcc-11 -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/usr/local/include -I/usr/include -I/home/nng8603/jarvis-AI/napyork2/include -I/home/linuxbrew/.linuxbrew/opt/python@3.12/include/python3.12 -c src/pyaudio/device_api.c -o build/temp.linux-x86_64-cpython-312/src/pyaudio/device_api.o
error: command 'gcc-11' failed: No such file or directory
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment