Install Environment yuminstallgccyuminstallzlib-develyuminstallmake download python version wgethttp: // www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
Installation environment
Yum install gcc
Yum install zlib-devel
Yum install make
Download python
Wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
Decompress, compile, and install
Tar-zxvf Python-3.4.0.tgz
Cd Python-3.4.0
./Configure-prefix =/opt/python3
Make all
Make install
Clear the previously compiled executable files and configuration files.
Make clean
Clear all generated files
Make distclean
View installed new version information
/Opt/python3/bin/python3-V
Python 3.4.0
The new version of python compilation and installation takes effect.
Make a soft connection to the bin directory of the current user
Ln-s/opt/python3/bin/python3 ~ /Bin/python3
After the new python version is upgraded and installed, the default value is still python2.6.
#! /Usr/bin/python #! /Opt/python3/bin/python3.