Installation Environment
Yum Install GCC
Yum Install Zlib-devel
Yum Install make
Download python version
wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
Unzip, compile, and install
TAR-ZXVF python-3.4.0.tgz
CD Python-3.4.0
./configure–prefix=/opt/python3
Make all
Make install
Clears the previously compiled executables and configuration files.
Make clean
Clear all the generated files
Make Distclean
View new version information for the installation
/opt/python3/bin/python3-v
Python 3.4.0
This shows that the new version of the compiled installation Python is in effect.
Make a soft connection to the current user's Bin directory
Ln-s/opt/python3/bin/python3 ~/bin/python3
After upgrading and installing the new version of Python, the default remains python2.6.
Modify the #!/usr/bin/python of the file header to #!/opt/python3/bin/python3.
This article is from the Linux Security Advisor blog, so be sure to keep this source http://chengyangyang.blog.51cto.com/9473151/1701140
CentOS 6.5 Installation Python3