You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04下用pip3安装PyAudio时遇portaudio.h缺失错误求助

Fixing "portaudio.h: No such file or directory" When Installing PyAudio via pip3 on Ubuntu 16.04

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-dev
    

    The update command 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:31:29