RedHat升级Python到2.7.6
程序员文章站
2022-05-31 16:06:32
...
python,发现还是原生的2.4.3,所以决定升级一下
[root@linuxidc ~]# python
Python 2.4.3 (#1, May 5 2011, 16:39:10)
>>>
[root@linuxidc ~]#
1.下载z最新版本的python
[root@linuxidc ~]# wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
可以在windows上下载后上传
2.解压及编译
[root@linuxidc ~]# tar xvf Python-2.7.2.tar.bz2
[root@linuxidc Python-2.7.6]# ./configure --prefix=/usr/local/python27
[root@linuxidc Python-2.7.6]# make
[root@linuxidc Python-2.7.6]# make install
[root@linuxidc Python-2.7.6]# ls /usr/local/python27/ -al
total 28
drwxr-xr-x 6 root root 4096 Mar 21 01:01 .
drwxr-xr-x 13 root root 4096 Mar 21 01:01 ..
3.覆盖原有的python链接
[root@linuxidc Python-2.7.6]# mv /usr/bin/python /usr/bin/python_old
[root@linuxidc Python-2.7.6]# ln -s /usr/local/python27/bin/python /usr/bin/python
[root@linuxidc Python-2.7.6]# python
[root@linuxidc ~]# python
Python 2.4.3 (#1, May 5 2011, 16:39:10)
>>>
[root@linuxidc ~]#
1.下载z最新版本的python
[root@linuxidc ~]# wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
可以在windows上下载后上传
2.解压及编译
[root@linuxidc ~]# tar xvf Python-2.7.2.tar.bz2
[root@linuxidc Python-2.7.6]# ./configure --prefix=/usr/local/python27
[root@linuxidc Python-2.7.6]# make
[root@linuxidc Python-2.7.6]# make install
[root@linuxidc Python-2.7.6]# ls /usr/local/python27/ -al
total 28
drwxr-xr-x 6 root root 4096 Mar 21 01:01 .
drwxr-xr-x 13 root root 4096 Mar 21 01:01 ..
3.覆盖原有的python链接
[root@linuxidc Python-2.7.6]# mv /usr/bin/python /usr/bin/python_old
[root@linuxidc Python-2.7.6]# ln -s /usr/local/python27/bin/python /usr/bin/python
[root@linuxidc Python-2.7.6]# python
推荐阅读
-
Centos Python2 升级到Python3的简单实现
-
Centos5.x下升级python到python2.7版本教程
-
CentOS 6.x系统升级Python到2.7版本的Shell脚本分享
-
Linux环境下python2.7.6升级python3.5.2
-
修复CentOS7升级Python到3.6版本后yum不能正确使用的解决方法
-
详解CentOS升级Python2.6到Python2.7并安装pip
-
CentOS6升级Python2.6到3.7,错误处理[No module named '_ctypes']
-
ubuntu16.04升级Python3.5到Python3.7的方法步骤
-
Centos5.x下升级python到python2.7版本教程
-
python2.6.6如何升级到python2.7.14