Solve – error: Microsoft Visual C++ 14.0 or greater is required in Python

Error: Microsoft Visual C++ 14.0 or greater is required in Python is a popular Python error, the error occurs when the installation of MS or Python is Faulty, the fix is very simple.

In this article I will describe in detail the solution that worked for me and the solutions that worked for other developers.

Explaining Error: Microsoft Visual C++ 14.0 or greater is required in Python

I had the latest version of 14.27 but I was getting the error above every time I tried to install a package on Python.

This is the error I was getting :

                                                                       #
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 
                                                                       #

After hours of research I fixed the problem and the error is gone, bellow are the possible solutions that may work for you, the first solution worked for me.

Solution 1 : download and install Microsoft C++ Build Tools

The first step is to google : Microsoft C++ Build Tools.

The second step is to download the Build tools and click install.

You may get a window asking you to resume or modify, just click on resume.

If that doesn’t work then just click on Modify and follow the instructions.

If none of the above works just update Microsoft Visual C++, the error was self explanatory when it comes to that, pay attention and make sure you update everything included there because trust me you will need all those components later.

This solution worked for me, but I have heard that It does not work in all cases, if you are one of the unlucky ones just make sure to check out the other possible solutions provided bellow.

Solution 2 : install all the vs code dependencies

When I tried to replicate the error above in order to try the solution I am going to show you here, I was shocked at how easy this solution was and it worked for me just fine.

This is a command line solution, you only need to copy and past the code bellow to the command line.

                                                                       #
vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools
                                                                       #

This solution worked for a lot of people, if it does not work, please try the solutions bellow.

Solution 3 : use upgrade setuptools, upgrade wheel and upgrade pip

If none of the above solutions worked, be patient this solution may work for you.

First you need to upgrade pip

                                                                       #
python -m pip install --upgrade pip
                                                                       #

Second, make sure to upgrade the wheel by following this code

                                                                       #
pip install --upgrade wheel
                                                                       #

Now you should upgrade the setuptools with the code bellow

                                                                       #
pip install --upgrade setuptools
                                                                       #

Last step is to try installing the package again after closing the terminal.

Solution 4 : uninstall everything and then install Conda

The last solution is to uninstall everything and then install Conda 

Installing Conda will automatically installs VS 15_runtime which compiles the wheels without any problems

If this solution or one of the above solutions did, consider donating to our Kofi account with the red button above in order to help us help other developers.

Summing-up

The error Microsoft Visual C++ 14.0 or greater is required is not an unusual error in Python, I hope you solved it with some help from this article, remember errors are normal in our field, that is where the fun is, keep coding and keep creating, cheers.

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