For Windows installations:
While running setup.py for package installations, Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS
environment
variable before calling setup.py
.
Execute the following command based on the version of Visual Studio installed:
- Visual Studio 2010 (VS10):
SET VS90COMNTOOLS=%VS100COMNTOOLS%
- Visual Studio 2012 (VS11):
SET VS90COMNTOOLS=%VS110COMNTOOLS%
- Visual Studio 2013 (VS12):
SET VS90COMNTOOLS=%VS120COMNTOOLS%
这么做的理由是Python2。7 扩展包是可以用08版或者更高的VS编译的,其setup.py(安装脚本)都是去windows系统寻找08版的VS,所以设置VS90的path
如果Python版本小于2.7,强烈建议使用 VS08版,用2010或者更高可能部分扩展不好使。
黑字参考自:http://blog.youkuaiyun.com/secretx/article/details/17472107