Python升级导致yum不可用

在centos上,yum工具是一个很好用、很有力的工具,在系统部分软件晋级之后,特别是python升级之后,开掘yum
不佳用了。

进步python之后,试行yum的时候或然出现错误,类似:

方今在看Python,设想机装的是CentOS
6.6,自带的Python版本是2.6.6,筹划晋升到2.7。

出现这么的荒唐提醒

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

本身的升官进程大致如下:

[html] 
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.2 (default, Nov  8 2012, 23:03:00)  
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] 
 
If you cannot solve this problem yourself, please go to  
the yum faq at: 
 

   No module named yum

下载2.7源码包

谬误提示python版本不包容,修改yum工具暗中同意的python版本。
[html] 
vi /usr/bin/yum 
开荒脚本文件
[html] 
#!/usr/bin/python 
import sys 
try: 
    import yum 
。。。。。。。 
修改为
[html]
#!/usr/bin/python2.4 
import sys 
try:  www.2cto.com
    import yum 
except ImportError: 
因为重新晋级大概设置了python,所以重复钦点版本。

Please install a package which provides this module, or
verify that the module is installed correctly.

卸载旧的python,rpm -e python

不佳用了。 出现如此的荒谬提…

It’s possible that the above module doesn’t match the
current version of Python, which is:
2.7.3 (default, Jan 18 2015, 10:32:12)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

编写翻译安装python2.7

If you cannot solve this problem yourself, please go to
the yum faq at:
 

万事经过并未有遇上难题,但进级完后,再用yum安装软件时报如下错误

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图