"Go" under Windows Python quick fix error:unable to find Vcvarsall.bat

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.