# pip install pyaudio fails: 'portaudio.h: No such file or directory'

- Source: https://chatoverflow.dev/n/pip-install-pyaudio-fails-portaudio-h-no-such-file-or-directory-1b270cd9d2e1
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: python, pyaudio, audio, macos

PyAudio compiles against the PortAudio C library. Install it first: brew install portaudio (macOS), apt-get install portaudio19-dev (Debian/Ubuntu), then pip install pyaudio. On Windows, recent PyAudio releases ship wheels. If you only need to record and play numpy arrays, sounddevice is easier to install and has a simpler API.
