CentOS 6.4系统升级自带的Python版本
一、查看系统信息
[root@localhost ~]# cat /etc/RedHat-release
CentOS release 6.4 (Final)
[root@localhost ~]# uname -r
2.6.32-358.el6.x86_64
二、查看已安装python版本
[root@localhost ~]# rpm -qa|grep python
python-2.6.6-36.el6.x86_64
libxml2-python-2.7.6-8.el6_3.4.x86_64
python-urlgrabber-3.9.1-8.el6.noarch
python-iwlib-0.1-1.2.el6.x86_64
python-libs-2.6.6-36.el6.x86_64
rpm-python-4.8.0-32.el6.x86_64
dbus-python-0.83.0-6.1.el6.x86_64
python-iniparse-0.3.1-2.1.el6.noarch
python-pycurl-7.19.0-8.el6.x86_64
libproxy-python-0.3.0-3.el6_3.x86_64
libreport-python-2.0.9-15.el6.centos.x86_64
newt-python-0.52.11-3.el6.x86_64
python-ethtool-0.6-3.el6.x86_64
abrt-addon-python-2.0.8-15.el6.centos.x86_64
[root@localhost ~]# python -V
Python 2.6.6
三、下载编译安装python2.7.5版本源码包
[root@localhost ~]# cd /usr/local/src
[root@localhost ~]# wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
[root@localhost ~]# tar xvf Python-2.7.5.tgz
[root@localhost ~]# cd Python-2.7.5
[root@localhost ~]# ./configure
[root@localhost ~]# make all
[root@localhost ~]# make install
[root@localhost ~]# make clean
[root@localhost ~]# make distclean
四、将系统默认的python版本设置为2.7.5
[root@localhost ~]# rm /usr/bin/python
[root@localhost ~]# ln -s /usr/local/bin/python2.7 /usr/bin/python
五、检查升级后的python版本
[root@localhost ~]# python -V
Python 2.7.5
零基础如何入门Python http://www.linuxidc.com/Linux/2016-10/136485.htm
Ubuntu 14.04安装Python 3.3.5 http://www.linuxidc.com/Linux/2014-05/101481.htm
CentOS上源码安装Python3.4 http://www.linuxidc.com/Linux/2015-01/111870.htm
《Python核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版] http://www.linuxidc.com/Linux/2013-06/85425.htm
《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码] http://www.linuxidc.com/Linux/2013-11/92693.htm
在CentOS 6.5上安装Python2.7 http://www.linuxidc.com/Linux/2016-10/136206.htm
在Ubuntu下用Python搭建桌面算法交易研究环境 http://www.linuxidc.com/Linux/2013-11/92534.htm
更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-11/137670.htm