Ubuntu 16.04下用pip3安装PyAudio时遇portaudio.h缺失错误求助
Hey, I’ve dealt with this exact error before on Ubuntu 16.04—let’s get it sorted out quickly!
The root cause here is that PyAudio relies on the PortAudio audio library, and your system is missing the development files for it (which include the portaudio.h header file). Here’s how to fix it step by step:
First, update your package list and install the PortAudio development package using Ubuntu’s package manager:
sudo apt-get update sudo apt-get install portaudio19-devThe
updatecommand ensures your package list is up to date, which helps avoid any unexpected installation issues.Once that’s done, go ahead and install PyAudio again with pip3:
pip3 install pyaudio
If you run into permission errors with pip3, you can add the --user flag to install it for your user account only instead of system-wide:
pip3 install --user pyaudio
That should resolve the missing header file error and get PyAudio installed successfully!
内容的提问来源于stack exchange,提问作者Monojit Sarkar

