This has been asked and answered a few times, but as you'll see none of the previous answers work for me -- I feel like something had changed to make all the old answers outdated. Or at the very least, I'm in some kind of edge case:
On a Windows 7 box, I've installed MinGW32 and Python 2.7 (32 bit version) (I've also tried this with Python 2.6 and got the same results).
Path environment variable is set correctly.
I've edited
cygwincompiler.py
to remove refrences to-mno-cygwin
. And I've put the correctdistutils.cfg
file intoC:\Python27\Lib\distutils
.To be clear:
distutils.cfg
contains[build] compiler=mingw32
on two lines.I've also (just to be safe) put
pydistutils.cfg
in my%HOME%
directory. And putsetup.cfg
in my current directory when runningpip
. They have same content asdistutils.cfg
.
I know this is all working because pip install cython
and pip install pycrypto
both compile successfully.
However, mysteriously, some packages still give me the unable to find vcvarsall.bat
error. Two examples are: pyproj and numpy.
It's as if sometimes pip
knows to use the MinGW compiler and sometimes it doesn't?
Moreover, if I use the MSYS shell that comes with MinGW then magically pip install numpy
succeeds. But pip install pyproj
still fails with an unable to find vcvarsall.bat
.
I've tried this out on several machines all with the exact same results.
Anybody have any idea what's going on here? Why would pip
know to use mingw32 to compile some c modules and not others? Also, why does pip install numpy
work inside the MSYS shell but not inside the cmd shell?
BONUS: Many, many older answers suggest installing Visual Studio 2008 as a way of solving a vcvarsall.bat
error. But as of this past May, microsoft is no longer distributing this software. Does anyone know of a place where one can still download VS2008? I ask because it's possible that being able to use vcvarsall.bat
instead of MinGW would solve this problem.