Python installation Extension "Unable to find Vcvarsall.bat" workaround

Source: Internet
Author: User

Cause:

python3.4 is compiled with msvs2010, so python3.4 can only recognize msvs2010 by default.

python2.7 is compiled with msvs2008, so python2.7 can only recognize msvs2008 by default.

Method One: Install MinGW (not recommended)

Download MinGW environment, add environment variable

or use

python setup.py build –compiler=mingw32

Method Two: install the corresponding version of the MSVs

Python2 Install Msvs2008,python3 installation msvs2010.

Method Three: set the variable

Python2 execution before installing the extension

SET VS90COMNTOOLS =  [vcvarsall.bat所在的目录]

Or

SET VS90COMNTOOLS=%VS120COMNTOOLS%

In the lake to smell the Zhang Note: vs120comntools changed to the version of the MSVS you installed corresponding

Python3 execution before installing the extension

SET VS100COMNTOOLS =  [vcvarsall.bat所在的目录]

Or

SET VS100COMNTOOLS=%VS120COMNTOOLS%

In the lake to smell the Zhang Note: vs120comntools changed to the version of the MSVS you installed corresponding

Method Four: Modify the installation script

Open it

[python3安装目录]Lib/distutils/msvc9compiler.py

To modify the Msvccompiler function:

vc_env = query_vcvarsall(VERSION, plat_spec)

For:

vc_env = query_vcvarsall(12.0, plat_spec)

In the lake to smell the Zhang Note: 12.0 changed to the MSVs you installed the corresponding version number

Add:

msvs2005 version number 8.0 corresponds to the environment variable Vs80comntools

msvs2008 version number 9.0 corresponds to the environment variable Vs90comntools

msvs2010 version number 10.0 corresponds to the environment variable Vs100comntools

msvs2012 version number 11.0 corresponds to the environment variable Vs110comntools

msvs2013 version number 12.0 corresponds to the environment variable Vs120comntools

Python installation Extension "Unable to find Vcvarsall.bat" workaround

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.