Windows7下pip安装包报错 Microsoft Visual C++ 9 0 is required Unabl

在Windows7x64系统中,使用pip安装包时遇到Microsoft Visual C++ 9.0缺失错误,找不到vcvarsall.bat。解决方案包括安装Microsoft Visual C++ Compiler for Python 2.7或修改Python的msvc9compiler.py文件,根据已安装的VS版本调整。如果遇到Python版本不匹配问题,需确保系统注册表中存在正确版本的Python。最终建议直接下载对应64位的安装包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

               

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了。

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值