发布时间:2019-09-16 07:35:53编辑:auto阅读(1935)
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
52064
51933
42155
38998
33502
30454
29086
24119
24026
22375
138°
159°
170°
154°
179°
164°
187°
199°
200°
208°