1. Download Python's latest installation package
Download with linux wget download (current latest version python2.7.10), under downloads below individual users
CD ~/downloads/
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
Then start downloading the following image:
Wait for download complete
Create a folder for the installation directory before compiling
mkdir/usr/local/python2.7.10
Extract:
TAR-ZXVF python-2.7.10.tgz
into the uncompressed folder
CD Python-2.7.10
Compiling in the uncompressed directory
./configure–prefix=/usr/local/python2.7.10
There are errors like the following, because I don't have GCC installed, so I need to install GCC or gcc-c++
2. Install the compilation environment GCC, there are many ways to install it * *
The first type: yum groupinstall "Development Tools"
The second type: yum install gcc gcc-c++ kernel-devel
The third type:
Yum Install GCC
Yum Install gcc-c++
Yum Install make
Everyone according to the needs of the choice, first and three ways I personally verify the feasibility of installation, after the compilation
./configure–prefix=/usr/local/python2.7.10
This can be compiled normally, without the above error.
Then
Make
Installation
Make Install 3. After the installation completes, needs to establish the soft connection and other processing
3.1 Renaming the old version
Mv/usr/bin/python/usr/bin/python_old
3.2 Create a new version of the link
Ln-s/usr/local/python2.7.10/bin/python2.7/usr/bin/python
3.3 Check the latest Python version
Python-v
Display the latest version information so you can start the latest version of the Python tour.