最简单粗暴的方法就是安装vs,vs2010、vs2012、vs2013都可以。
我的是vs2010,在cmd下设置一下变量就可以了。
python 2.7在setup的时候查找的是VS2008编译的,如果你电脑上没有这个版本的话,比如只有:
1.Visual Studio 2010,在cmd里面执行:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
2. Visual Studio 2012 的话:
SET VS90COMNTOOLS=%VS110COMNTOOLS%
以此类推:
3. Visual Studio 2013 的话:
SET VS90COMNTOOLS=%VS120COMNTOOLS%
更多参考:http://www.biaodianfu.com/python-error-unable-to-find-vcvarsall-bat.html
http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat