查看python的版本
[root@localhost ~]
python -V
Python 2.4.3
Python 2.4.3
1.先安装GCC
yum -y install gcc
2.下载Python-2.7.3
[root@localhost ~]
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
3.解压Python-2.7.3
[root@localhost ~]
tar -jxvf Python-2.7.3.tar.bz2
4.进入刚解压后的文件夹(可使用命令):
[root@localhost ~]
cd Python-2.7.3
5.安装
[root@localhost Python-2.7.3]
./configure
[root@localhost Python-2.7.3] make all
[root@localhost Python-2.7.3] make install
[root@localhost Python-2.7.3] make all
[root@localhost Python-2.7.3] make install
6.查看版本信息
/usr/local/bin/python2.7 -V
7.建立软连接,使系统默认的python指向python2.7
ln -fs /usr/local/bin/python2.7 /usr/bin/python运行python查看版本
python -V