1. View the default Python version
Python-v
2. Download the source package, wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
3. (if required) install GCC for compiling Python source code
Yum Install GCC
4. Compiling the installation
Tar zvxf python-2.7.11.tgz
CD Python-2.7.11
./configure (default installation in/usr/local/lib/python2.7)
Make a && make install
5. View version
/usr/local/bin/python2.7-v
6. Modify the default Python version
mv/usr/bin/python/usr/bin/python2.6
Ln-s/usr/local/bin/python2.7/usr/bin/python
7. To prevent Yum from performing exceptions, modify the Python version used by Yum
Vi/usr/bin/yum
Change the head #!/usr/bin/python to #!/usr/bin/python2.6
Attached: Under Windows just set the environment variable path "; C:\Program files (x86) \python2\ "(assuming the installation path is C:\Program Files (x86) \python2\) Take care not to miss the preceding semicolon (;).
Linux under python2.7.x version installation