zoukankan      html  css  js  c++  java
  • 升级python导致yum命令无法使用

    错误信息:

    [root@aliyun /]# yum
    There was a problem importing one of the Python modules required to run yum. The error leading to
    this problem was: No module named yum 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.8 (default, Dec 3 2014, 08:48:50) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq

    查看yum版本:

    [root@aliyun /]# rpm -qa|grep yum
    yum-3.2.29-60.el6.centos.noarch
    yum-metadata-parser-1.1.2-16.el6.x86_64
    PackageKit-yum-0.5.8-23.el6.x86_64
    yum-plugin-fastestmirror-1.1.30-30.el6.noarch
    PackageKit-yum-plugin-0.5.8-23.el6.x86_64
    yum-utils-1.1.30-30.el6.noarch
    yum-plugin-security-1.1.30-30.el6.noarch

    查看python版本:

    [root@aliyun /]# whereis python
    python: /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local/python2.7 /usr/share/man/man1/python.1.gz

    查找yum文件,并编辑此py文件

    [root@aliyun /]# which yum
    /usr/bin/yum

    再次运行yum,成功运行。

    至此,修复成功。

  • 相关阅读:
    phpstorm常用快捷键
    tp3.2.3运用phpexcel将excel文件导入mysql数据库
    TP3.2加载外部PHPexcel类,实现导入和导出
    Navicat常用快捷键
    thnkphp框架面试问题
    PHPSQL注入
    PHP4个载入语句的区别
    goflyway简单使用
    ubuntu16.04 HyperLedger Fabric 1.2.0 开发环境搭建
    DApp demo之pet-shop
  • 原文地址:https://www.cnblogs.com/ggjjl1/p/4139139.html
Copyright © 2011-2022 走看看