English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Solution to Unable to find vcvarsall.bat Error When Installing PIL Module in Python

Many people may have encountered this error when using setup.py to install Python2.7Python will default to searching for the installed vs on the computer when installing the image processing module PIL2008.If you haven't installed vs2008, and the error Unable to find vcvarsall.bat will occur.

How to solve this error? Here is the solution to this error.

You can set VS9Use the 0COMNTOOLS environment variable to guide python to identify a new vs and then execute setup.py to continue the installation.

If you have installed vs2010, execute in cmd:

SET VS90COMNTOOLS=%VS100COMNTOOLS% 

If installed vs2012, execute in cmd:

SET VS90COMNTOOLS=%VS110COMNTOOLS% 

If you have installed vs2013, execute in cmd:

SET VS90COMNTOOLS=%VS120COMNTOOLS% 

If you find VS too big and don't want to install it, you can also install MinGW to solve the problem.

1Find the bin folder under the MinGW installation directory, find mingw32-make.exe, copy one and rename it to make.exe

2Add the MinGW path to the environment variable path, for example, I installed MinGW to D:\MinGW\, so I added D:\MinGW\bin to the path;

3Add a file named distutils.cfg to <python installation directory>\distutils and input the following in the file:

[build] 
compiler=mingw32 

Save the file and it's done.

Summary

This is the solution to the error Unable to find vcvarsall.bat when installing the PIL module for Python, hoping it can bring some help to your learning or work. If you have any questions, you can leave a message for communication.

You May Also Like