[root@lee ~]# 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.4 (default, Apr 9 2013, 17:12:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
[root@lee ~]#
因为yum头部默认制定python脚本的路径就是
复制代码 代码如下:
#! /usr/bin/python
你把旧版的python替换后就是用不了,不知道为何新版Python不能被yum识别,目前唯一最好解决的方法就是修改yum头部声明
改成
复制代码 代码如下:
#! /usr/bin/python2.6
即可,这里的python2.6是我centos默认版本,大家的默认版本是多少请按实际情况修改即可