码迷,mamicode.com
首页 > 其他好文 > 详细

No module named yum

时间:2015-01-18 22:28:19      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

升级python之后,执行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, Jan 18 2015, 10:32:12)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

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

一般可以通过修改/usr/bin/yum脚本中对python的引用解决。步骤如下:

1、查看当前python版本:

技术分享

2、查看系统中已安装的python:

技术分享

3、修改yum脚本

从以上两步骤中得出,之前的python版本应该是2.6,

vi /usr/bin/yum

将#!/usr/bin/python修改为#!/usr/bin/python2.6。再执行yum,恢复正常了。

No module named yum

标签:

原文地址:http://www.cnblogs.com/BlueBreeze/p/4232345.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!