Installation of Python under Linux
The installation steps are as follows
1 Preparing the compilation environment
Yum Groupinstall ' Development Tools '
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel sqlit
2 Download Python3.5 Code package
wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.5.2/PYTHON-3.5.2.TAR.XZ
3 compiling
Tar jxvf python-3.5.2.tar.xz
CD Python-3.5.2
./configure--prefix=/usr/local/python3
Make && make install
4 Setting environment variables
Echo ' Export path= $PATH:/usr/local/python3/bin ' >> ~/.BASHRC
5 Setting up the directory (this is done by typing Python3 in any directory of the system to invoke the python3.5 command)
Mv/usr/bin/python/usr/local/python.bak
Rm-rf/usr/local/python2
Ln-sv/usr/local/python2.6/usr/bin/python2
Ln-sv/usr/local/python3/bin/python3.5/usr/bin/python
6 Modify the Yum script to point to the old version of Python, which avoids Yum's inability to run
Sed-i ' S$#!/usr/bin/python$#!/usr/bin/python2.6$g '/usr/bin/yum
7 Testing
The input python appears as follows
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/A4/36/wKioL1mmh4vDrtwaAAAiEiQNoz0936.png-wh_500x0-wm_ 3-wmp_4-s_168776994.png "style=" Float:none; "title=" Qq20170830173335.png "alt=" Wkiol1mmh4vdrtwaaaaieiqnoz0936.png-wh_50 "/>
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/05/85/wKiom1mmh6CB9R02AAAiTVNEqtE337.png-wh_500x0-wm_ 3-wmp_4-s_1067576740.png "style=" Float:none; "title=" Qq20170830173357.png "alt=" Wkiom1mmh6cb9r02aaaitvneqte337.png-wh_50 "/>
This article is from the "surgery industry has specialized, if only" blog, please be sure to keep this source http://fustudy.blog.51cto.com/13154622/1961160
Realization of coexistence of python2 and Python3 in Centos6.5