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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7系统升级后yum update 出错No module named pycurl相关的知识,希望对你有一定的参考价值。

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

以上是关于centos7系统升级后yum update 出错No module named pycurl的主要内容,如果未能解决你的问题,请参考以下文章

[linux]centos7 升级python后出现“No module named yum”错误

yum -y upgrade 和 yum -y update 区别

Linux中升级更新命令yum upgrade和yum update的区别

CentOS下的yum upgrade和yum update区别,没事别乱用,和Ubuntu的update不一样!

centos7mini版后 可用的一些命令

yum update