yum错误信息“No module named yum”

2013-01-04 3,202次浏览 发表评论

使用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.3 (default, Dec 26 2012, 17:02:57)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq

貌似是在说Python版本不兼容。记得前两天安装新版本的Python。

解决方法:不需要重新编译安装python,也不需要重新安装yum。使用vim打开/usr/bin/yum,修改shebang(第一行)信息#!/usr/bin/python#!/usr/bin/python2.4,保存退出即可。

评论

随便说点,聊聊天~