在Windows上从源码安装Python的一些模块时经常会碰到的问题:
error: Unable to find vcvarsall.bat
之前就记录在了Word文档中,这次放在blog上方便查看。
1.设置环境变量
执行:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
2.再去安装:
setup.py install
就可以正常,编译,安装了。
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.
If you have Visual Studio 2010 installed, execute
SET VS90COMNTOOLS=%VS100COMNTOOLS%
or with Visual Studio 2012 installed (Visual Studio Version 11)
SET VS90COMNTOOLS=%VS110COMNTOOLS%
or with Visual Studio 2013 installed (Visual Studio Version 12)
SET VS90COMNTOOLS=%VS120COMNTOOLS%
参考链接:
- http://www.simapple.com/216.html
- http://www.crifan.com/python_mmseg_error_unable_to_find_vcvarsall_bat/
- http://www.biaodianfu.com/python-error-unable-to-find-vcvarsall-bat.html
- http://www.cnblogs.com/xiangzhong/archive/2013/05/29/3105616.html
- http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat