I. Installation steps
1. Check the system python
CentOS 6.8 comes with Python 2.6.6,yum, the newest and Python 2.6.6, and can only download Python 2.7.12 's source code to compile and install itself. Such as:
- Installing development tools
#yum-y Groupinstall "Development tools"
- Install packages required for compiling Python
#yum Install Zlib-devel-y
#yum Install Bzip2-devel-y
#yum Install Openssl-devel-y
#yum Install Ncurses-devel-y
#yum Install Sqlite-devel-y
#yum Install Tcl-devel–y
#yum Install Tk-devel-y
4. Download and unzip the source code of the Python 2.7.12
#cd/opt
#wget--no-check-certificate Https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
#tar XF Python-2.7.12.tar.xz
#cd Python-2.7.12
#tar XF Python-2.7.12.tar.xz
#cd Python-2.7.12
- Compiling and installing Python 2.7.12
#./configure--prefix=/usr/local
#make && make Install
6. Point the python command to the Python 2.7.12cd/usr/bin
#rm –RF python
#ln-S/usr/local/bin/python2.7/usr/bin/python
#python –version
Completed by the python2.7 installation shown
If you are interested in this, please scan the QR code below for free for more details
Centos6.8 Installing the Python environment