10002---如何在已经存在python2的linux环境上安装python3

来源:互联网 发布:淘宝安德鲁吉他怎么样 编辑:程序博客网 时间:2024/05/21 07:15
最近看到好多人都在问在已经存在python2.7的环境下如何安装python3,于是我决定写下这篇文档,供大家学习参考,希望能够给大家带来帮助。

有的人在安装的时候可能会先将python2卸载掉,这个地方严重强调一下,不要去卸载系统中已经存在的python2,否则会造成系统中好多其他需要python执行的程序异常。

python3.4的安装方法

[root@localhost install]# wget https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz[root@localhost install]# tar -zxf Python-3.4.4.tgz[root@localhost install]# cd Python-3.4.4# 在安装包中有一个README的文件,里面有写如何安装[root@localhost Python-3.4.4]# lsaclocal.m4    config.sub  configure.ac  Grammar  install-sh  LICENSE  Makefile.pre.in  Modules  Parser  PCbuild        Python  setup.pyconfig.guess  configure   Doc           Include  Lib         Mac      Misc             Objects  PC      pyconfig.h.in  README  Tools[root@localhost Python-3.4.4]# ./configure[root@localhost Python-3.4.4]# make[root@localhost Python-3.4.4]# make install

测试

[root@localhost Python-3.4.4]# python3Python 3.4.4 (default, Jun 27 2016, 07:47:54) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 


0 0
原创粉丝点击