升级python(linux)
查看系统当前python版本
2: [root@wangyuelou ~]# python
Python 2.4.3 (#1, May 5 2011, 16:39:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>;>>
[root@wangyuelou ~]#
下载新版本的python
[root@wangyuelou ~]# wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
解压缩 以及编译
[root@wangyuelou ~]# tar xvf Python-2.7.2.tar.bz2
[root@wangyuelou Python-2.7.2]# ./configure --prefix=/usr/local/python27
[root@wangyuelou Python-2.7.2]# make
[root@wangyuelou Python-2.7.2]# make install
[root@wangyuelou Python-2.7.2]# ls /usr/local/python27/ -al
total 28
drwxr-xr-x 6 root root 4096 Jul 14 00:21 .
drwxr-xr-x 20 root root 4096 Jul 14 00:17 ..
drwxr-xr-x 2 root root 4096 Jul 14 00:21 bin
drwxr-xr-x 3 root root 4096 Jul 14 00:21 include
drwxr-xr-x 4 root root 4096 Jul 14 00:21 lib
drwxr-xr-x 3 root root 4096 Jul 14 00:21 share
覆盖原来的python链接
[root@wangyuelou Python-2.7.2]# mv /usr/bin/python /usr/bin/python_old
[root@wangyuelou Python-2.7.2]# ln -s /usr/local/python27/bin/python /usr/bin/
[root@wangyuelou Python-2.7.2]# python