Chinaunix首页 | 论坛 | 博客
  • 博客访问: 535135
  • 博文数量: 142
  • 博客积分: 2966
  • 博客等级: 少校
  • 技术积分: 1477
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-07 22:37
文章分类

全部博文(142)

文章存档

2013年(3)

2012年(21)

2011年(53)

2010年(33)

2009年(32)

分类: Python/Ruby

2010-04-08 11:47:13

 
CentOS 5.3系统默认Python版本是2.4.3
 
[root@TC-Boss ~]# python -V
Python 2.4.3
 
   由于应用需要升级到Python 2.5.4,由于yum包管理是用python写的,仅仅单独升级python会导致yum无法使用.
出现这种情况的主要原因在于新安装的Python没有YUM服务所依赖的Packages.
 
[root@TC-Boss ~]# 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.5.4 (r254:67916, Feb 24 2010, 10:03:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you cannot solve this problem yourself, please go to
the yum faq at:
 
 
解决方法:
查找yum文件,并编辑此py文件
[root@TC-Boss ~]# which yum
/usr/bin/yum
[root@TC-Boss ~]# vi /usr/bin/yum
 
#!/usr/bin/python
改为:
#!/usr/bin/python2.4
 
然后保存OK.
 

 
阅读(3002) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~