“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.
Did work for me but only with double dash :
> setup.py install build –compiler=mingw32
@fallino
double dash wich are here interpreted as em dash, ok …. so here is the ‘copy&paste’ version
> setup.py install build ––compiler=mingw32
@fallino
I actually did use
instead of the
in this post, but the WordPress code makes it visible as one stripe. I have put it in pre-code tag so that the double stripe is visible now. Thanks for pointing that out.
This saved me a day. Thanks
Thanks for the information – that helped me a lot.
But you have to put C:\MinGW\bin to the path
Of course. Updated the article. Thanks for the comment.
Awesome, this was driving me crazy. Thanks!
Hi there,
I have MS Visual Studio C++ installed, I know exactly where vcvarsall.bat is located on my machine. I have added its location to PATH. I have also tried to launch the command “python C:/mypath/setup.py install” from the directory where vcvarsall.bat is.
Either way, I still get an “unable to find vcvarsall.bat”.
Anyone knows why???
Thanks
@tregou
I am trying to install PIL by the way.
@tregou you must have VC2008 installed http://mail.python.org/pipermail/python-list/2010-April/1242706.html
Thank you, that saved me a lot of work!
I met following error:
building ‘psyco._psyco’ extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DNDEBUG=1 -DALL_STATIC=1 -Ic\i3
86 -IC:\Python27\include -IC:\Python27\PC -c c/psyco.c -o build\temp.win-amd64-2
.7\Release\c\psyco.o
cc1.exe: error:unrecognized command line option ‘-mno-cygwin’
error: command ‘gcc’ failed with exit status 1
I got the error: ‘gcc’ failed: Permission denied. How can I change ?
Hi. I am getting the same error as Mike and Qi, please help
7\Release\c\psyco.o
cc1.exe: error:unrecognized command line option ‘-mno-cygwin’
error: command ‘gcc’ failed with exit status 1
If you are getting this error ‘-mno-cygwin’ thats probably because youare using the latest gcc.
Either install older gcc version or do this:
goto /Libs/disutils/cygwincompiler.py and remove all the occurence of -mno-cygwin.