之前在cent os 5里把python 2.4 升级 到2.7.2
几个命令:
wget
http://python.org/ftp/python/2.7.2/Python-2.7.2.tgztar -zxpvf Python-2.7.2.tgz -C /opt
cd /opt/Python-2.7.2
./configure
make
make install
输入python,发现还是默认的2.4版本。
修改一下:
[root@s1211836 bin]# cd /usr/bin/
[root@s1211836 bin]# rm -rf python
[root@s1211836 bin]# ln -s /usr/local/bin/python ./python
重新试试:
[root@s1211836 bin]# python
Python 2.7.2 (default, Aug 29 2012, 22:24:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
默认python版本已经变成了2.7.2