码迷,mamicode.com
首页 > 编程语言 > 详细

Python升级(2.4升级到2.7.3)

时间:2015-10-15 16:30:01      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:python升级

一、下载安装包,然后进行升级部署

[root@a2 tmp]# tar zxvf Python-2.7.3.tgz 
[root@a2 Python-2.7.3]# ./configure && make && make install 
[root@a2 Python-2.7.3]# which python
/usr/local/bin/python
[root@a2 Python-2.7.3]# ln -sf /usr/local/bin/python /usr/bin/python
[root@a2 Python-2.7.3]# python -V
Python 2.7.3

二、处理升级后,yum的情况

由于Python升级后,看下原有yum是否还能正常使用

[root@a2 Python-2.7.3]# yum clean all
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, Dec 17 2013, 17:33:06) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq

三、修改yum配置文件

[root@a2 Python-2.7.3]# vim /usr/bin/yum 
将“#!/usr/bin/python”改为“#!/usr/bin/python2.4”
[root@a2 Python-2.7.3]# yum clean all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning up Everything




本文出自 “冰冻vs西瓜” 博客,请务必保留此出处http://molewan.blog.51cto.com/287340/1703119

Python升级(2.4升级到2.7.3)

标签:python升级

原文地址:http://molewan.blog.51cto.com/287340/1703119

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