xxxxxxxxxx
$ sudo apt-get install libasound-dev &&\
cd ~/Downloads &&\
curl -O http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz &&\
tar -zxvf pa_stable_v190700_20210406.tgz &&\
cd portaudio &&\
./configure &&\
make &&\
sudo make install &&\
sudo pip install pyaudio && pip install SpeechRecognition
Credit to https://stackoverflow.com/questions/20023131/cannot-install-pyaudio-gcc-error
I just compact it.So we can just copy and hooray
xxxxxxxxxx
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
pip install pyaudio --user