I am currently trying to install PyAudio to use SpeechRecognition in python. I get the error fatal error: portaudio.h: No such file or directory
(entire error:
`Collecting PyAudio
Using cached PyAudio-0.2.14.tar.gz (47 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: PyAudio
Building wheel for PyAudio (pyproject.toml): started
Building wheel for PyAudio (pyproject.toml): finished with status 'error'
Failed to build PyAudio
error: subprocess-exited-with-error
× Building wheel for PyAudio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/pyaudio
copying src/pyaudio/__init__.py -> build/lib.linux-x86_64-cpython-311/pyaudio
running build_ext
building 'pyaudio._portaudio' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/src
creating build/temp.linux-x86_64-cpython-311/src/pyaudio
x86_64-unknown-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python3.11 -I/usr/include/x86_64-linux-gnu/python3.11 -c src/pyaudio/device_api.c -o build/temp.linux-x86_64-cpython-311/src/pyaudio/device_api.o
src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directory
9 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-unknown-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyAudio
ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects`.
I installed portaudio19-dev, and it didn’t do anything. I can find the file under /usr/include/portaudio.h, but, again, it doesn’t find it. all dependencies for portaudio are installed as well. I tried both pip install PyAudio
and pip install --user PyAudio
. Neither work. I am on Linux Mint 21.3 x86_64 and use Pycharm 2024.1.1. Hope someone could help.
I installed portaudio19-dev, and it didn’t do anything. I can find the file under /usr/include/portaudio.h, but, again, it doesn’t find it. all dependencies for portaudio are installed as well. I tried both pip install PyAudio
and pip install --user PyAudio
. Neither work. I am on Linux Mint 21.3 x86_64 and use Pycharm 2024.1.1. Hope someone could help.
For Accounts is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.