安装后python 2.7.3 yum坏了

时间:2012-11-26 20:29:05

标签: linux yum

我安装了libxml2-2.9.0和libxslt-1.1.27然后yum打破了我运行的任何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.4.3 (#1, Jan 21 2009, 01:11:33) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]

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

然后我认为python版本太旧了并且安装python 2.7.3并从头开始安装它,经过一些错误的试验后它变得越来越糟,现在当我运行'python -V'时我得到版本'Python 2.7。 3',当我运行'/ usr / bin / python -V'时,它返回'python-2.4.3-24.el5',无论我做了什么,yum仍然被该消息打破。我怎么能回到yum? 我的操作系统是:linux 2.6.18-164.11.1.el5 x86_64 GNU / Linux

1 个答案:

答案 0 :(得分:0)

请参阅the FAQ

  

在2.3之前。? yum此错误消息通常会产生误导。看到了   真正的错误,从命令行运行python,然后输入import yum。该   问题可能不是你的python版本,而是一个   缺少libxml2-python,python-sqlite或python-elementtree包。

     

Yum 2.4.x提供了与模块导入错误不同的错误,因此   这将变得不那么令人困惑。

     

它还包含一个将错误发送到邮件列表的指令。   真的,你应该弄清楚rpm提供的模块是什么   丢失并尝试安装。

     

如果您收到的消息是yum本身就是缺少的模块   然后你可能安装它incorreclty(或安装源   rpm使用make / make install)。如果可能的话,找一个预先建好的rpm   将像Fedora或CentOS一样为您的系统工作。或者,你可以   下载srpm并做一个

     

rpmbuild --rebuild yum * .src.rpm

因此,如果其他方法失败,您可以在this之类的地方获取yum包。

相关问题