Sidenote

by Nikolas Demiridis

This actually started as a way to post (and archive) anything I was finding to be insteresting enough. Now it actually serves as a kind of memo notes to myself.
This is an English language blog.

error: Unable to find vcvarsall.bat - Solution for the Visual Studio users

I admit it! I use a PC to write my Django apps. To be more accurate, I not only use a PC (instead of a MAC), I also run Windows 2008 Server on it and use VS2012 as my IDE! I know I must be something of a mad Microsoft fanboy, that buys anything Microsoft creates and adore Bill Gates as a god, or… I might just be reasonable.

The point is that I often have to install python packages that require compiling, such as the Python Imaging Library or ReportLab. If anyone has ever tried to install such libraries with either pip install pil or downloading the package and running setup.py install he may have received the message

error: Unable to find vcvarsall.bat

This message just states that he cannot find a compiler for the package. The solution is either installing MinGW32, or if you already have the VS2012 installed, use the VS compiler. If you want a permanent solution, then you have to add the System Variable VS90COMNTOOLS to point to the Visual Studio Common Tools folder. If you don’t know the Visual Studio Common Tools folder check the screenshot to where you can find it.

The quick solution would be to run

SET VS90COMNTOOLS=%VS110COMNTOOLS%

before runing the setup.py install or the pip install pil command.

System Variables

The screenshot is in Swedish and the windows titles are System Properties (Systemegenskaper) and Environment Variables (Miljövariabler)