今天遇到了这个方面的问题,目前找到两种办法。一种是换编译器如mingw,另一种是装vc。第一种方法没成功,现在正在等第二种。 第一种: 首先安装MinGW; 把MinGW的路径添加到环境变量path中,比如MinGW安装在D:\MinGW\中,就把D:\MinGW\bin添加到path中; 打开命令行窗口,在命令行窗口中进入到要安装代码的目录下; 输入如下命令就可以安装了。setup.py install build --compiler=mingw32
第二种: 今天在安装pyscopg2库的时候出现Unable to find vcvarsall.bat错误,在网上找了一会儿,有人说是要装mingw来解决,我试了,但是不行后来找到另一种解决办法: 我的以上方法都不管用,看到stackoverflow有一种方法: 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 If you have Visual Studio 2010 installed, execute
or with Visual Studio 2012 installed
我的是vs2010,在cmd下设置一下变量就可以了。 更多参考:http://www./python-error-unable-to-find-vcvarsall-bat.html http:///questions/2817869/error-unable-to-find-vcvarsall-bat |
|