centos系统升级python 2.7.3
首先下载源tar包
可利用linux自带下载工具wget下载,如下所示:
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
下载完成后到下载目录下,解压
tar -zxvf Python-2.7.3.tgz
进入解压缩后的文件夹
cd Python-2.7.3
在编译前先在/usr/local建一个文件夹python27(作为python的安装路径,以免覆盖老的版本)
mkdir /usr/local/python2.7.3
在解压缩后的目录下编译安装
./configure --prefix=/usr/local/python2.7.3 make make install
此时没有覆盖老版本,再将原来/usr/bin/python链接改为别的名字
mv /usr/bin/python /usr/bin/python_old
再建立新版本python的链接
ln -s /usr/local/python2.7.3/bin/python2.7 /usr/bin/python
这个时候输入
python
就会显示出python的新版本信息
Python 2.7.3 (default, Sep 29 2013, 11:05:02) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
相关推荐
huavhuahua 2020-11-20
weiiron 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
guangcheng 2020-11-13
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06
jacktangj 2020-11-04
lousir 2020-11-04
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17