How to fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python?

Sometimes, we want to fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python.

In this article, we’ll look at how to fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python.

How to fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python?

To fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python, we install pipwin and use it to install pyaudio.

To fix this, we run

pip install pipwin
python -m pipwin install pyaudio

to install pipwin.

And then we use pipwin to install pyaudio with

python -m pipwin install pyaudio

on Windows.

On Ubuntu distributions, we run

sudo apt install portaudio19-dev

to install the portaudio19-dev package before installing pyaudio.

Conclusion

To fix installation issues for PyAudio, PortAudio: “fatal error C1083: Cannot open include file: ‘portaudio.h’: No such file or directory” with Python, we install pipwin and use it to install pyaudio.