Solving Python Pyaudio AttributeError: Could not find PyAudio; check installation

Python Pyaudio AttributeError: Could not find PyAudio; check installation is an error which occurs because you have a faulty PyAudio installation.

My goal today is to provide a clear and detailed explanation of why this error is happening and how to solve it, we will also check out other ways to get rid of this problem for good.

Exploring Python Pyaudio AttributeError: Could not find PyAudio; check installation

This is an error which occurs because you have a faulty PyAudio installation.

Beware of mixing between errors. Double check if the error message looks like the error message bellow, then continue.

                                                                       #
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation 
                                                                       #

Bellow, we will describe how the error can be solved. With multiple possible methods.

Solution 1 : Correctly install Pyaudio and its dependencies

Doing a Pyaudio installation can be hard sometimes, the best way to perform the installation is to not only install Pyaudio but also install the Pyaudio dependencies.

Do this in the correct order bellow.

First, you should install pipwin using the pip package manager.

                                                                       #
pip install pipwin
                                                                       #

Then you should install the following pyaudio dependencies :

libportaudio2

libasound2-dev

libportaudiocpp0

ffmpeg

portaudio19-dev

You can do that using the following command

                                                                       #
pip install portaudio19-dev ffmpeg libportaudiocpp0 libportaudio2 libasound2-dev 
                                                                       #

Finally, use pipwin to install pyaudio

                                                                       #
pipwin install pyaudio
                                                                       #

I hope this great method helped you solve the problem, if not then check the method bellow.

Solution 2 : Install Microsoft Visual C++ Build Tools before installing Pyaudio

The error can also happen if your system is missing the Microsoft Visual C++ Build Tools

The solution is simple, you should follow this link https://visualstudio.microsoft.com/downloads/

and then install Microsoft Visual C++ Build Tools.

Make sure you do this before installing pyaudio.

What you should do now, is basically jumping to the first solution and following the steps.

The first step is to install pipwin etc …

                                                                       #
pip install pipwin
                                                                       #

After finishing the whole process, the error should be gone.

I hope the fixes above fixed your problem, thank you for reading this entire blog post.

Summing-up : 

We arrived at the end of this quest to solve this annoying error, I hope me sharing my experience with you helped, I hope the other solutions helped, If you like this website support us on Kofi and keep browsing, thank you.

Thank you for reading my blog post to the end, If you want to learn more about the Python programming language, check out the official Python Documentation : https://docs.python.org/3/