Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

Posted on

Solving problem is about exposing yourself to as many situations as possible like Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) and practice these strategies over and over. With time, it becomes second nature and a natural way you approach any problems in general. Big or small, always start with a plan, use other strategies mentioned here till you are confident and ready to code the solution.
In this post, my aim is to share an overview the topic about Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat), which can be followed any time. Take easy to follow this discuss.

Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

I’ve installed Python 3.5 and while running

pip install mysql-python

it gives me the following error

error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

I have added the following lines to my Path

C:Program FilesPython 3.5Scripts;
C:Program FilesPython 3.5;
C:WindowsSystem32;
C:Program Files (x86)Microsoft Visual Studio 12.0VC;
C:Program Files (x86)Microsoft Visual Studio 11.0VC

I have a 64bit win 7 setup in my PC.

What could be the solution for mitigating this error and installing the modules correctly via pip.

Asked By: Umanda

||

Answer #1:

Your path only lists Visual Studio 11 and 12, it wants 14, which is Visual Studio 2015. If you install that, and remember to tick the box for Languages->C++ then it should work.

On my Python 3.5 install, the error message was a little more useful, and included the URL to get it from

 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

Edit: New working link

Edit: As suggested by Lightfire228, you may also need to upgrade setuptools package for the error to disappear:

pip install --upgrade setuptools
Answered By: davidsheldon

Answer #2:

Binary install it the simple way!

I can’t believe no one has suggested this already – use the binary-only option for pip. For example, for mysqlclient:

pip install --only-binary :all: mysqlclient

Many packages don’t create a build for every single release which forces your pip to build from source. If you’re happy to use the latest pre-compiled binary version, use --only-binary :all: to allow pip to use an older binary version.

Answered By: Alastair McCormack

Answer #3:

To solve any of the following errors:

  • Failed building wheel for misaka
  • Failed to build misaka
  • Microsoft Visual C++ 14.0 is required
  • Unable to find vcvarsall.bat

The Solution is:

  1. Go to Build Tools for Visual Studio 2017

  2. Select free download under Visual Studio Community 2017. This will download the installer. Run the installer.

  3. Select what you need under workload tab:

    a. Under Windows, there are 3 choices. Only check Desktop development with C++

    b. Under Web & Cloud, there are 7 choices. Only check Python development (I believe this is optional But I have done it).

  4. In cmd, type pip3 install misaka
    enter image description here

Note if you already installed Visual Studio then when you run the installer, you can modify yours (click modify button under Visual Studio Community 2017) and do steps 3 and 4

Screenshot of Modify button

Final Note : If you don’t want to install all modules, having the 3 ones below (or a newer version of the VC++ 2017) would be sufficient. (you can also install the Visual Studio Build Tools with only these options so you dont need to install Visual Studio Community Edition itself) => This minimal install is already a 4.5GB, so saving off anything is helpful
The modules you need for c++ compiler

Answered By: WISAM

Answer #4:

As the other responses pointed out, one solution is to install Visual Studio 2015. However, it takes a few GBs of disk space. One way around is to install precompiled binaries. The webpage http://www.lfd.uci.edu/~gohlke/pythonlibs (mirror) contains precompiled binaries for many Python packages. After downloading the package of interest to you, you can install it using pip install, e.g. pip install mysqlclient?1.3.10?cp35?cp35m?win_amd64.whl.

Answered By: Franck Dernoncourt

Answer #5:

I had the exact issue while trying to install Scrapy web scraping Python framework on my Windows 10 machine. I figured out the solution this way:

  1. Download the latest (the last one) wheel file from this link ? wheel file for twisted package
    enter image description here

  2. I’d recommend saving that wheel file in the directory where you’ve installed Python i.e somewhere in Local Disk C

  3. Then visit the folder where the wheel file exists and run pip install <*wheel file's name*>

  4. Finally run the command pip install Scrapy again and you’re good to use Scrapy or any other tool which required you to download massive Windows C++ Package/SDK.

Disclaimer: This solution worked for me while trying to install Scrapy, but I can’t guarantee the same happening while installing other softwares/packages/etc.?

Answered By: Sushant Chaudhary

Answer #6:

After reading a lot of answers in SO and none of them working, I finally managed to solve it following the steps in this thread, I will leave here the steps in case the page dissapears:

Please try to install Build Tools for Visual Studio 2017, select the workload “Visual C++ build tools” and check the options “C++/CLI support” and “VC++ 2015.3 v14.00 (v140) toolset for desktop” as below.

enter image description here

Hope it helps as it did for me.

Answered By: ElBaulP

Answer #7:

I had this exact issue while trying to install mayavi.

So I also had the common error: Microsoft Visual C++ 14.0 is required when pip installing a library.

Example of Error

After looking across many web pages and the solutions to this thread, with none of them working. I figured these steps (most taken from previous solutions) allowed this to work.

  1. Go to Build Tools for Visual Studio 2017 and install Build Tools for Visual Studio 2017. Which is under All downloads (scroll down) >> Tools for Visual Studio 2017
    • If you have already installed this skip to 2.

Installing Build Tools

  1. Select the C++ Components you require (I didn’t know which I required so installed many of them).
    • If you have already installed Build Tools for Visual Studio 2017 then open the application Visual Studio Installer then go to Visual Studio Build Tools 2017 >> Modify >> Individual Components and selected the required components.
    • From other answers important components appear to be: C++/CLI support, VC++ 2017 version <...> latest, Visual C++ 2017 Redistributable Update, Visual C++ tools for CMake, Windows 10 SDK <...> for Desktop C++, Visual C++ Build Tools core features, Visual Studio C++ core features.

Select Components

  1. Install/Modify these components for Visual Studio Build Tools 2017.

  2. This is the important step. Open the application Visual Studio Installer then go to Visual Studio Build Tools >> Launch. Which will open a CMD window at the correct location for Microsoft Visual StudioYYYYBuildTools.

Open Visual Studio Installer
Launch Visual Studio Build Tools
CMD Build Tools Window

  1. Now enter python -m pip install --upgrade setuptools within this CMD window.

CMD Update Setuptools

  1. Finally, in this same CMD window pip install your python library: pip install -U <library>.

CMD Install Python Library

Answered By: Aldahunter

Answer #8:

Use this link to download and install Visual C++ 2015 Build Tools. It will automatically download visualcppbuildtools_full.exe and install Visual C++ 14.0 without actually installing Visual Studio. After the installation completes, retry pip install and you won’t get the error again.

I have tested it on following platform and versions:

Python 3.6 on Windows 7 64-bit
Python 3.8 on Windows 10 64-bit

I have same suggestion as a comment to the question, however, I have been requested to post this as an answer as it helped a lot of people. So I posted it as an answer.

Answered By: Lalit Kumar B

Leave a Reply

Your email address will not be published.