发布时间:2019-09-16 07:35:53编辑:auto阅读(1694)
linux升级python到2.7
一、下载python2.7安装包
# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
二、解压
# tar -zxf Python-2.7.12.tgz # cd Python-2.7.12
三、新建安装目录,防止覆盖旧版本
# mkdir /usr/local/python27
四、安装
# cd Python-2.7.12 # ./configure --prefix=/usr/local/python27 # make && make install
五、旧版python改名
# mv /usr/bin/python /usr/bin/python24
六、创建链接到新版本
# ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
七、测试
# python Python 2.7.12 (default, Sep 2 2016, 09:17:20) [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
上一篇: Python中操作mysql知识(一)
下一篇: Python -- 关于pip安装Ipy
48726
47760
38532
35730
30169
26905
25937
20779
20545
18937
325°
397°
434°
453°
439°
432°
483°
554°
666°
680°