When installing the Pyaudio module with the PIP tool, the following error is always reported:
fatal error: portaudio.h: No such file or director
Tried a variety of methods, then re-read the official website of the document, the above is said:
for Debian/ubuntu
To install Pyaudio using the Package Manager:
sudo apt-get install python-pyaudio python3-pyaudio
If you do not have the latest version of Pyaudio, install it using PIP:
pip install pyaudio
Notes:
- pip will download the Pyaudio source and build it for your system. Be sure to install the Portaudio Library Development Kit (
portaudio19-dev
) and the Python development package ( python-all-dev
) beforehand.
- In order to better isolate the system package, consider in Virtualenv Install Pyaudio .
I use sudo apt-get install python-pyaudio python3-pyaudio then pip install Pyaudio solve the problem
Report:
Microsoft Windows
Use Pip installation :
python -m pip install pyaudio
Notes:
- if the PIP has not been bundled with your Python installation, please in here get .
- PIP will acquire and install the Pyaudio wheel (pre-packaged binary file). Currently, there are wheels compatible with the official releases of Python 2.7,3.4,3.5 and 3.6 . for these versions, 32-bit and 64-bit wheels can be used.
- These binaries include the Portaudio v19 v190600_20161030 built using MinGW. They support only the Windows MME API, and do not include support for Directx,asio, and so on. If you need to support APIs that are not included, you need to compile Portaudio and Pyaudio.
Ubuntu installation Pyaudio can't find python.h problem