centos7系统升级后yum update 出错No module named pycurl

本文记录了Centos7系统中使用yum更新时遇到的问题及解决方案,包括因pycurl模块版本不匹配导致的错误,并提供了详细的安装和验证步骤。

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

Centos7升级后,运行yum update 结果如下 :
]# yum update
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named pycurl

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, May 3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq

安装pycurl:

pip install pycurl

Collecting pycurl
Using cached pycurl-7.43.0.1.tar.gz
Installing collected packages: pycurl
Running setup.py install for pycurl ... done
Successfully installed pycurl-7.43.0.1

测试升级,运行yum update
]# yum updae
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, May 3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq

网上找了好多资料,没有一个合适,检查另外一个相同配置的电脑,发现pycurl的版本是7.19.0 。卸载pycurl7.43.0,pip uninstall pycurl.重新安装指定的版本:pip install pycurl==7.19.0
]# pip install pycurl==7.19.0
Collecting pycurl==7.19.0
Using cached pycurl-7.19.0.tar.gz
Installing collected packages: pycurl
Running setup.py install for pycurl ... done
Successfully installed pycurl-7.19.0
测试升级,运行yum update
]# yum update -y
Loaded plugins: amazon-id, fastestmirror, rhui-lb, search-disabled-repos
Loading mirror speeds from cached hostfile

  • city-fan.org: www.city-fan.org
  • epel: ny-mirrors.evowise.com
  • rhui-REGION-client-config-server-7: rhui2-cds02.us-east-1.aws.ce.redhat.com
  • rhui-REGION-rhel-server-releases: rhui2-cds02.us-east-1.aws.ce.redhat.com
  • rhui-REGION-rhel-server-rh-common: rhui2-cds02.us-east-1.aws.ce.redhat.com
    No packages marked for update
    成功执行命令

后记,开始安装pycurl的时候,只能手动去安装。由于是云主机,直接下载相同版本的iso镜像文件(3分钟下载5G左右的文件),挂载并拷贝2个rpm文件到本地系统。libcurl-7.29.0-42.el7.x86_64.rpm , libcurl-devel-7.29.0-42.el7.x86_64.rpm

由于包依赖,单独安装失败,进入到rpm所在文件夹,运行命令安装,rpm -Uvh *.rpm --nodeps --force

转载于:https://blog.51cto.com/10108149/2062449

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值