The installation steps are as follows: 1 prepare the compilation environment (environment if not, you may encounter various problems, such as wget cannot download https linked files) Yum Groupinstall development Toolsyum Install Zlib-devel Bzip2-devel Openssl-devel Ncurses-devel 2 down
1 ready to compile the environment (if the environment is not correct, you may encounter various problems, such as wget unable to download the HTTPS link file)
yum groupinstall ' Development tools ' yum install zlib-devel bzip2-devel openssl-devel ncurses-devel
2 download 3.5 Code Package
wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.5.0/PYTHON-3.5.0.TAR.XZ
3 compiling
Tar jxvf python-3.5.0.tar.xzcd python-3.5.0./configure--prefix=/usr/local/python3make && make install
4 Setting environment variables
Echo ' Export path= $PATH:/usr/local/python3/bin ' >> ~/.BASHRC
5 or you can replace Python2 directly
rm /usr/bin/pythonln -sv /usr/local/python3/bin/python3.5 /usr/bin/ Python
But at the same time this will result in the python2.6-dependent yum not being used, so also modify the Yum configuration.
6 Update Yum configuration.
Vim/usr/bin/yum change the configuration of Yum via vim #!/usr/bin/python to #!/usr/bin/python2.6
Save exit. Completed the installation of the Python3.
install PIP
PIP is installed according to the website wiki.
1, install Setuptools. Before PIP installation, you need to install Setuptools, which is given in the above page. Download and execute:
wget Https://pypi.python.org/packages/source/s/setuptools/setuptools-5.7.zip--no-check-certificateunzip Setuptools-5.7.zip CD setuptools-5.7python setup.py install wget wget https://pypi.python.org/packages/source/p/pip/ Pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196tar xvf pip-7.1.2.tar.gzcd pip-7.1.2python setup.py Install
Just fill it out.
This article is from the "Target: India" blog, please be sure to keep this source http://shunzi115.blog.51cto.com/5184443/1795377
CentOS 6 Installation Python3.5