Chinaunix首页 | 论坛 | 博客
  • 博客访问: 409852
  • 博文数量: 43
  • 博客积分: 613
  • 博客等级: 中士
  • 技术积分: 756
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-01 11:25
文章分类

全部博文(43)

文章存档

2016年(1)

2015年(5)

2014年(5)

2013年(14)

2012年(18)

分类: LINUX

2013-11-13 11:30:08

今天在虚拟机上执行yum -y install命令遇到错误,如下:

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, Sep 10 2013, 12:19:14) 
[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:
 


yum和Python是依赖关系,yum是python的模块,由于上次更新了Python版本导致这次的问题发生。。

解决办法:
    [root@nginx1 boot]# python
Python 2.7.4 (default, Sep 10 2013, 12:19:14) 

然后修改yum
 vi /usr/bin/yum

修改头#!/usr/bin/python  => #!/usr/bin/python2.4
再次运行就OK了。
阅读(2780) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~