Error microsoft visual c++ 14.0 is required. pyaudio

Error microsoft visual c++ 14.0 is required. pyaudio, is a popular error that occurs when you are missing a correct installation of ms 14 or other important components.

Do not worry, in this post I will do my best to show you how I solved this issue and how other developers solved it with other different solutions.

Explaining : Error microsoft visual c++ 14.0 is required. pyaudio

The problem is in this case in the installation of MS C++ 14, we will jump directly to the solutions without wasting time.

                                                                       #
python --version
                                                                       #

Solution 1 : Correctly download and install the wheel .whl file

First of all, you should start by finding your Python version, all you have to do is open the terminal and run the line of code bellow :

Find your Python version by python –version mine is 3.7.3 for example the easiest way to check either you have 64 or 32 Python just open it in the terminal:

My Python version was Python 3.7, to know which windows you have 32 or 64 there are many ways, most people can figure that out easily.

Now navigate to this link : https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

And find the appropriate .whl file, in my case the file is : PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl

Now, download that file, navigate to the downloads folder on your computer and install it by running pip followed by install and then the name of the file.

This is how the code in your terminal should look like :

                                                                       #
pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
                                                                       #

If this did not work, please make sure to use cd followed by the directory where the file is downloaded. In order to change the directory on the command line to where the file is located.

This is the solution that worked for me, but as always, while I was looking for a solution I discovered other solutions that worked for a lot of people, I also tried them and some of them worked for me, so keep reading.

Solution 2 : use conda install PyAudio instead of pip install PyAudio

For a lot of people using pip to install did not work, so they replaced pip with conda and everything worked as it is supposed to. the code will look like this :

                                                                       #
conda install PyAudio
                                                                       #

I hope this does solve your issue, if not, let us see other possible solutions.

Solution 3 : install pipwin then install pyaudio

This is another solution that I have tried and it worked for me, open your IDE of choice, in my case I use the command line as administrator, please open it as admin.

Thene run the following commands :

                                                                       #
pip install pipwin
                                                                       #
                                                                       #
pipwin install pyaudio
                                                                       #

I found this one to be the easiest and best possible solution to this error, if you found my article valuable please help us create more content and help more developers by donating to our Kofi account above, any help is appreciated, cheers.

If none of the above possible solutions, I have other solutions that may work for you.

Solution 4 : upgrade setuptools

Another solution to the problem is to install Visual Studio 2015, install Visual C++ 14.0 build tools.

Then run the code bellow

                                                                       #
pip install --upgrade setuptools
                                                                       #

We have another solution for Linux users, it is the one bellow.

Solution 5 : use install portaudio-devel

On Linux, run the code bellow :

                                                                       #
sudo dnf install portaudio-devel 
                                                                       #

You have just installed alsa-lib-devel, portaudio-devel and portaudio. Now all you have to do is install pyaudio by running the code bellow

                                                                       #
pip install pyaudio
                                                                       #

I hope this worked for you, Linux users, cheers

Summing-up

This is the end of our article, a fresh install of pyaudio if done the proper way is able to solve this issue for most developers including me, I hope you found our article and website useful, never give up, keep creating and keep coding. Errors are normal in our field, cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/