1)首先,下载一个Microsoft Visual C++ Compiler for Python 2.7的补丁,下载地址在这里:

http://www.microsoft.com/en-us/download/details.aspx?id=44266

2) 然后下载安装VS2008(对应VER9.0),如果电脑上安装的是VS2010(对应VER10.0),

可以在VS命令行下执行:SET VS90COMNTOOLS=%VS100COMNTOOLS%

如果你安装的是 2012 版(对应VER11.0), SET VS90COMNTOOLS=%VS110COMNTOOLS%

如果你安装的是 2013版(对应VER12.0), SET VS90COMNTOOLS=%VS120COMNTOOLS%

或用以下方法也一样可以解决:

3) “unable to find vcvarsall.bat”这句话出在msvc9compiler.py中

再研究这个文件发现问题所在了:

它是在注册表中寻找到vs的目录,再去在vs目录下找vcvarsall.bat。

但是问题就出在python32里面默认是vc9.0也就是vs2008所以它在注册表里面找不到键值返回None

productdir = Reg.get_value(r"%s/Setup/VC" % vsbase,

"productdir")

vsbase值为:Software/Microsoft/VisualStudio/9.0

具体修改代码如下:

msvc9compiler.py中

def find_vcvarsall(version) 用于查找vcvarsall.bat version就是版本号,实际上是9.0

vc_env = query_vcvarsall(VERSION, plat_spec)

VERSION = get_build_version() 因为python32自己是由vc9.0构建的所以VERSION是9.0

修改MSVCCompiler函数:

vc_env = query_vcvarsall(VERSION, plat_spec)

为:

vc_env = query_vcvarsall(12.0, plat_spec)

不过还有这句话:

if VERSION < 8.0:

raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)

看来,python3.2中的distutils只支持vc8.0以上,即vs2005以上的编译器。

4)之后安装还是报错:“ error: command 'mt.exe' failed with exit status 31”

编辑Python27\Lib\distutils\msvc9compiler.py,查找ld_args.append('/MANIFESTFILE:' + temp_manifest)一行,在其后添加一行,内容为ld_args.append('/MANIFEST')

5)之后安装就成功了!

python27(32位)安装模块报错“error: Unable to find vcvarsall.bat”的更多相关文章

  1. 在windows下安装lxml 报错error: Unable to find vcvarsall.bat

    刚开始安装 ,我是使用命令pip install lxml直接进行安装,不过出错了 error: Unable to find vcvarsall.bat 解决方案: 1.首先安装wheel,pip ...

  2. 安装visual stdio 2017后依然报错:Unable to find vcvarsall.bat

    安装visual stdio 2017后依然报错:Unable to find vcvarsall.bat 解决办法:更新setuptools 原文章:https://blog.csdn.net/wl ...

  3. pip install mysql-python报错1. Unable to find vcvarsall.bat 2 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory 3.error: command 'mt.exe' failed with exit statu

    最近在安装mysql -python 时报错折腾了半天,通过以下方法解决: 1. pip install mysql-python报错 Unable to find vcvarsall.bat (参考 ...

  4. Rabbitmq安装报错 Windows下安装RabbitMQ报错Error: unable to connect to node rabbit@xxx: nodedown

    1..erlang.cookie文件不一致 如果是Windows 64位系统两个文件都要修改,另外当C:\Users\用户\.erlang.cookie没有修改权限的时候 用上面这个文件覆盖下面两个目 ...

  5. python pip安装模块报错 "Can't connect to HTTPS URL because the SSL module is not available."

    在升级python版本为3.6之后,pip安装模块报错. 报错信息如图: 原因是系统自带的openssl版本与python3的版本不匹配,所以这里只要升级openssl版本就可以解决问题. yum - ...

  6. python 安装模块报错 response.py", line 302, in _error_catcher

    python 安装模块报错 Exception:Traceback (most recent call last): File "/usr/share/python-wheels/urlli ...

  7. windows上,python安装非官方包,提示error: Unable to find vcvarsall.bat

    在windows机器上安装python非官方包,如果环境只是用于开发,不作任何测试的话,最好的解决办法是: 在Linux上pip安装好之后,把python根目录lib/python3.6/site-p ...

  8. Python error: Unable to find vcvarsall.bat

    在安装一些Python模块时,大部分是cpython写的模块时会发生如下错误 error: Unable to find vcvarsall.bat.先前的一篇文章:在Windows上安装Scrapy ...

  9. 【转】Windows下Python快速解决error: Unable to find vcvarsall.bat

    转自:http://blog.csdn.net/sad_sugar/article/details/73743863 系统配置:Windows10 x64, Visual Studio 2017, P ...

随机推荐

  1. 51nod 1240 莫比乌斯函数

    题目链接:51nod 1240 莫比乌斯函数 莫比乌斯函数学习参考博客:http://www.cnblogs.com/Milkor/p/4464515.html #include<cstdio& ...

  2. 第一章 UI实战开发 UIWindow UIView

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  3. c#判断IP是否可以Ping通

    Ping pingSender = new Ping(); PingReply reply = pingSender.Send("127.0.0.1",120);//第一个参数为i ...

  4. react验证码倒计时

    <!DOCTYPE html> <html> <head> <script src="../build/react.js">< ...

  5. 5、HTML5列表、块和布局

    1.块元素 块元素在显示的时候,通常会以新行开始 如:<h1> <p> <ul> <!-- 块—>注释 <p>hello</p> ...

  6. Mysql 服务在本机,需要单机调试Mysql数据库 发生 不认识hostname‘localhost’

    今天在本机安装Mysql Server然后用Workbench打开,连接本机数据库 hostname:localhost port:3306 弹出:localhost 不能连接 错误-1042 尝试了 ...

  7. C# 进程和线程

    一.进程和线程 进程是对一段静态指令序列的动态执行过程,是系统进行资源分配和调度的基本单位.与进程相关的信息包括进程的用户标志.正在执行的已经编译好的程序.程序和数据在存储器中的位置等.同一个进程有可 ...

  8. GDB中汇编调试

    GDB中汇编调试 1.输入代码 2.使用gcc - g example.c -o example -m32指令在64位的机器上产生32位汇编,时遇到问题使用-m32指令报错,参考卢肖明同学博客知道这是 ...

  9. Ant介绍

    今天介绍一下Ant,Ant是基于Java的跨平台构建工具,它易于使用,并且可扩展.可升级.它既可以用于小的个人项目,也可以用于大型的.多组协同的软件项目. 在我们的项目开发中,为了构建一个软件产品,我 ...

  10. Oracle存储过程例子:运用了正则表达式、数组等

    代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-- ...