Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vcvarsall.bat needed for python to compile missing from visual studio 2015 ( v 14)

I am trying to install numpy in python 3.5 under windows 10 with visual studio 2015 ultimate installed.

Short version: file vcvarsall.bat is missing from vs14 folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC folder. Why?

Long version: Running pip install numpy gives me this error error: Unable to find vcvarsall.bat

researching this error got me to several stackoverflow answers that helped me figure out that python needs c++ compiler to compile some of the packages. And it needs the to do it using the same version of compiler that was used to compile python 3.5 ( error: Unable to find vcvarsall.bat ). My python is compiled using [MSC v.1900 64 bit (AMD64)] - which is vs 14 ( visual studio 2015 )

Moving further with my research i learned out from: pip install gives error: Unable to find vcvarsall.bat that get_build_version() from $python_install_prefix/Lib/distutils/msvc9compiler.py returns the version of vs that shoud be used to find the path of vcvarsall.bat For me this method returns 14. So everything correct.

Now when I look into the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC there file vcvarsall.bat is missing.

But when I look into the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC there is a vcvarsall.bat.

Why is vcvarsall.bat missing from vs 14.0 ??

like image 200
Dorin Avatar asked Oct 24 '15 20:10

Dorin


People also ask

Can not find Vcvarsall bat?

When you see “unable to find vcvarsall. bat”, it means you're installing a package that has an extension module, but only the source code. “vcvarsall. bat” is part of the compiler in Visual Studio that is necessary to compile the module.

How do I fix Microsoft Visual C++ 14.0 required error?

To Solve error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools” You just need to Install Microsoft Visual C++ 14.0. First of all just download Visual C++ 2015 Build Tools from given link. And That will install Visual C++ 14.0 without installing Visual Studio.

What compiler does Visual Studio use for Python?

Visual Studio 2019 contains Visual C++ 14.2 compiler. The setuptools Python package version must be at least 34.4.


3 Answers

Make sure C++ Common Tools are installed in Visual Studio.

Programs and Features -> VS 2015 -> Change

VS2015 setup

like image 91
Bohdan Avatar answered Oct 09 '22 00:10

Bohdan


I've come across this problem before when trying to install numpy. Although I was unable to fix the 'vcvarsall.bat' problem, I found that i could download pre compiled libraries from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ Download the libraries you want, navigate to wherever the downloaded .whl files are and open a command prompt window. run 'pip install [whl file name]' This will install the library for you with no compile issue.

like image 40
R21 Avatar answered Oct 09 '22 01:10

R21


I downloaded the Microsoft Visual C++ build Tools Link Here and everything worked great.

like image 2
Bhanuday Birla Avatar answered Oct 09 '22 00:10

Bhanuday Birla