Installing Python3.5
Preparing the Environment for compilation
Yum Groupinstall ' development tools ' yum install yum install zlib-devel bzip2-devel openssl-devel ncurses-devel Sqlite-dev Elreadline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2. Download the installation package
Wget
3. Compiling
Tar XF python-3.5.0.tgz cd Python-3.5.0./configure--prefix=/usr/local/python3 make do install
4. Setting Environment variables
Echo ' Export path= #PATH:/usr/local/python3/bin ' >> ~/.BASHRC
5. Replace Python2
Rm/usr/bin/pythonln-sv/usr/local/bin/python3.5/usr/bin/python
(This is done by typing the python3.5 command in any directory of the system, not the system default of 2.6.6.) However, this will result in the python2.6-dependent yum not being used and therefore also modifying the Yum configuration)
6. Updating the Yum configuration
Ll/usr/bin | grep python
(The/usr/bin directory below contains the following files (ll | grep python), where there is a python2.6, just specify the yum configuration for Python to point to here)
Vim/usr/bin/yum
change yum configuration via Vim, #!/usr/bin/python to #!/usr/bin/python2.6, save exit, complete Python3 installation
7. Run Python
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/EC/wKioL1j5fOTQKVz0AABV7-3mrkE470.png-wh_500x0-wm_ 3-wmp_4-s_2875986706.png "title=" Python.png "alt=" Wkiol1j5fotqkvz0aabv7-3mrke470.png-wh_50 "/>
This article is from the "11275984" blog, please be sure to keep this source http://11285984.blog.51cto.com/11275984/1918038
CentOS 6 Installation Python3.5