Transferred from: http://blog.csdn.net/sad_sugar/article/details/73743863
System configuration: Windows10 x64, Visual Studio, Python2.7.1
Error message: error:unable to find Vcvarsall.bat
Cause of error: At the time of generation, the compiler%pythoninstallpath%\distutils\msvc9compiler.py 219 rows from the Find_vcvarsall (version) The Vcvarsall.bat file could not be found in the function.
More specifically, msvc9compiler.py extracts the msvc version number from Sys.version, but the registry does not find Vcvarsall.bat based on the version number, and the path to the version number is not found in the system's environment variable. Later I added a path to the environment variable based on the version number, but because the msvc9compiler.py is primarily for path recognition by VS2008 and VS2010, Vcvarsall.bat is not properly found.
Workaround: Return the absolute path of the Vcvarsall.bat directly in the Find_vcvarsall (version) function.
For example, in My computer, the path to msvc9compiler.py is D:\Program files\python27\lib\distutils\msvc9compiler.py, where Find_vcvarsall is on line No. 219, The path to vcvarsall.ba is C:\Program Files (x86) \microsoft Visual Studio\preview\enterprise\vc\auxiliary\build\vcvarsall.bat "。 In Def find_vcvarsall (version): Add directly below
Vcvarsall = r "C:\Program Files (x86) \microsoft Visual Studio\preview\enterprise\vc\auxiliary\build\vcvarsall.bat"
return vcvarsall;
Save it.
"Go" under Windows Python quick fix error:unable to find Vcvarsall.bat