Mac Pyaudio Installation fatal error: ‘portaudio.h‘ file not found

I’m about to cry by myself.
first of all, install portaudio

brew install portaudio

Secondly, find the installation path of portaudio

sudo find/-name "portaudio.h"

In my example, my path is stored in /opt/Hometree/cellular/portaudio/19.7.0/include/portaudio. H

Finally, replace the portaudio path with your own and run the following code

pip install --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio

Read More: