首页 > 其他 > 详细

No module named yum

时间:2015-04-10 20:29:10      阅读:171      评论:0      收藏:0      [点我收藏+]

更新python版本后出现此问题

[root@huntdb src]# python
Python 2.7.9 (default, Apr 10 2015, 13:32:39) 

[root@huntdb src]# yum install openssl*
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.9 (default, Apr 10 2015, 13:32:39) 
[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新版本中没有yum模块导致,将python版本改低即可:

[root@huntdb src]# whereis python
python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/include/python2.4 
/usr/local/python2.7 /usr/share/man/man1/python.1.gz

[root@huntdb src]# vi /usr/bin/yum
修改第一行#!/usr/bin/python为#!/usr/bin/python2.4


本文出自 “HUNT” 博客,请务必保留此出处http://hunt1574.blog.51cto.com/1390776/1630949

No module named yum

原文:http://hunt1574.blog.51cto.com/1390776/1630949

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!