error: Unable to find vcvarsall.bat


在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%

 

参考链接:
,

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注