“Unable to find vcvarsall.bat” error when trying to install rdflib
Some things just don’t work out like you expect them to do. During my quest with a new web application that I’m about to develop, the very first and basic thing went wrong. The setup of the rdflib python library (version 2.4.2) gave me the following error (on Windows):
“error: Setup script exited with error: Unable to find vcvarsall.bat”
After a lot of useless spent hours on trying to come up with some solution, the answer was found. There is a good solution on the project page of the library too, but I found a slightly quicker solution:
- First of all download MinGW. You need g++ compiler and MingW make in setup.
- If you installed MinGW for example to “C:\MinGW” then add “C:\MinGW\bin” to your PATH in Windows.
- Now start your Command Prompt and go the directory where you have your setup.py residing.
- Last and most important step:
setup.py install build --compiler=mingw32
Note: This is all about rdflib version 2.4.2! Version 3.x for example has some major differences with 2.4.2 and so I’m not aware whether the problem there exists and even if it does, i’m not sure if it can be solved by the above solution.
If you have a similar problem but with some other module and you can’t fix it in this way, then you should try this.
In many other cases it was sufficient to install Visual C++ 2008 Express Edition. You can download it here.