Solution to Unable to find vcvarsall.bat error when installing PIL module in python

高洛峰
Release: 2017-02-22 16:17:36
Original
1098 people have browsed it

Many people may have encountered this error. When using setup.py to install the python2.7 image processing module PIL, python will by default look for vs2008 installed on the computer. If you do not install vs2008, Unable will appear to find vcvarsall.batError.

So how to solve this error? Here's how to fix this error.

You can set the VS90COMNTOOLS environment variable to guide python to recognize a new vs. and then execute setup.py to continue the installation.

If you have installed vs2010, execute in cmd:

SET VS90COMNTOOLS=%VS100COMNTOOLS%
Copy after login

If you have installed vs2012, Execute in cmd:

SET VS90COMNTOOLS=%VS110COMNTOOLS%
Copy after login

If you installed vs2013, execute in cmd:

SET VS90COMNTOOLS=%VS120COMNTOOLS%
Copy after login

If you think VS is too big and don’t want to install it, you can also install MinGW to solve it.

1. Find the bin folder in the MinGW installation directory, find mingw32-make.exe, make a copy and rename it make.exe

2 . Add the path of MinGW to the environment variable path. For example, if I install MinGW in D:\MinGW\, then add D:\MinGW\bin to the path;

3. \distutilsAdd the file distutils.cfg, enter in the file:

[build] 
compiler=mingw32
Copy after login

and save the file.

Summary

The above is the solution to the Unable to find vcvarsall.bat error encountered when python installs the PIL module. I hope it can It will be helpful to everyone’s study or work. If you have any questions, you can leave a message to communicate.

For more related articles on the solution to the Unable to find vcvarsall.bat error when installing the PIL module in python, please pay attention to the PHP Chinese website!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!