转自:http://www.weidianyuedu.com/http://www.weidianyuedu.com/
ython2.7是2.X的最后一个版本,同时她也加入了一部分3.X的新特性。并且具有更好的性能,修改多个bug。所以决定升级到最新的2.7版,我的目前的版本是2.4.3
查看当前python版本
[root@pythontab.com ~]# python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
1.最新版本python下载安装
下载新版本的python
[root@pythontab.com ~]# wget http://python.org/ftp/python/2.7.8/Python-2.7.8.tgz
解压缩 以及编译
[root@pythontab.com ~]# tar xvf Python-2.7.8.tar.bz2
[root@pythontab.com Python-2.7.8]# ./configure --prefix=/usr/local/python27
[root@pythontab.com Python-2.7.8]# make
[root@pythontab.com Python-2.7.8]# make install
最新2.7.8版本的python已经安装到了系统中,但是还没有完成
再次查看python版本,发现依然是2.4.3版本
[root@pythontab.com ~]# python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.