Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7919424
  • 博文数量: 701
  • 博客积分: 2150
  • 博客等级: 上尉
  • 技术积分: 13233
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-29 16:28
个人简介

天行健,君子以自强不息!

文章分类

全部博文(701)

文章存档

2019年(2)

2018年(12)

2017年(76)

2016年(120)

2015年(178)

2014年(129)

2013年(123)

2012年(61)

分类: Python/Ruby

2014-07-16 11:47:33

升级python版本后,运行yum
# yum -y 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.3 (default, Jul 15 2014, 16:52:36) 
[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:
 

分析应该是yum和Python是依赖关系,yum是python的模块,所以需要修改yum来解决:
1. 查看python的安装路径
# python
Python 2.7.3 (default, Jul 15 2014, 16:52:36) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
# whereis python
python: /usr/bin/python2.4 /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.4 /usr/local/bin/python 
/usr/local/bin/python2.6-config /usr/local/bin/python3.3-config /usr/local/bin/python3.3 /usr/local/bin/python3.3m 
/usr/local/bin/python3.3m-config /usr/local/bin/python2.6 /usr/local/lib/python2.4 /usr/local/lib/python3.3 
/usr/local/lib/python2.6 /usr/include/python2.4 /usr/share/man/man1/python.1.gz

2. 修改yum
# vim /usr/bin/yum
将 #!/usr/bin/python 改成  #!/usr/bin/python2.4
【保存并退出】

3. 再测试yum安装,成功;
阅读(10245) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~