Workaround for Python unable to find vcvarsall.bat error when installing PIL module

Source: Internet
Author: User
Many people may have encountered this error when using setup.py to install the python2.7 image processing module PIL, Python will look for the vs2008 installed on the computer by default. If you do not have VS2008 installed, it will appear Unable to find vcvarsall.batError.

So how to solve this mistake? Here is the solution to this error.

You can boot Python by setting the VS90COMNTOOLS environment variable to identify a new vs. then execute setup.py to continue with the installation.

If you installed the VS2010, execute it in cmd:

SET vs90comntools=%vs100comntools%

If vs2012 is installed, execute in CMD:

SET vs90comntools=%vs110comntools%

If you installed the vs2013, execute it in cmd:

SET vs90comntools=%vs120comntools%

If you think that the VS is too big, do not want to install, also can install MinGW to solve.

1, find the Bin folder in the MinGW installation directory, find Mingw32-make.exe, copy the name of the Make.exe

2, add the path of the MinGW to the environment variable path, for example, I put the MinGW installed into the D:\MinGW\, the D:\MinGW\bin added to the path;

3, in the <python installation directory >\distutils add File Distutils.cfg, in the file input:

[Build] Compiler=mingw32

Save the file.

Summarize

The above is the Python installation PiL module encountered unable to find Vcvarsall.bat error solution, I hope that everyone's study or work to bring certain help, if there is doubt you can message exchange.

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.