Windows7下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

Windows7下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

在Windows7x64下使用pip安装包的时候提示报错:Microsoft Visual C++ 9.0 is required  (Unable to find vcvarsall.bat)

如果你的系统没有VS2008的话,可以安装一个Micorsoft Visual C++ Compiler for Python 2.7的包,如果安装了更高版本的VS的话,可以通过修改“C:\Python27\Lib\distutils\msvc9compiler.py”文件来解决这个问题。

可以通过注册表查看你安装的版本号:


然后修改文件中的“find_vcvarsall(version)”函数,添加一句“version = 10.0”;10.0为你安装的版本号。

def find_vcvarsall(version):
    """Find the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    """
    version = 10.0
    vsbase = VS_BASE % version
    try:
        productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
                                   "productdir")
    except KeyError:
        productdir = None
但这个问题解决之后还是不能安装,又遇到问题:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':no such file or directory

下载安装包安装又遇到:Python Version 2.7 required which was not found in the registry

最后直接去下载64位的安装包就OK了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值