Wednesday 5 May 2010

Setuptools (easy_install) can't find vcvarsall.bat

So, using easy_install very regularly ended up with the following error being produced:

error: Setup script exited with error: Unable to find vcvarsall.bat

I'd read that I needed to install Visual Studio, so I installed version 10 and set the Path variable. The command prompt could see vcvarsall but not easy_install. grrr!!

The trick seems to be to install mingw from here (http://www.mingw.org/) and make sure you select the base tools, g++ compiler and make stuff. Then add `C:\MinGW\bin' to your Path and create a file called disutils.cfg in C:\Python26\Lib\distutils and put the follow in it:

[build]
compiler=mingw32

Then exit from your command prompt, open it up again and all should be fine! The solution was found in a comment here:

http://code.google.com/p/rdflib/issues/detail?id=104