您的位置:首页 > 编程语言 > Python开发

Python升级(2.4升级到2.7.3)

2015-10-15 11:49 513 查看
一、下载安装包,然后进行升级部署
[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[/code]三、修改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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: