Linux versions of the system have their own Python interpreter, you can enter Python in the Shell interface to enter the interactive interface, and display the Python version information;
The most popular version now is the version of PYTHON2.7,CENTOS6, which installs 2.6.6 by default, and Centos7 installs the 2.7.* version by default.
If the Python version of CENTOS6 is too low, you want to upgrade to the version you specified:
Access official website:https://www.python.org/
Download Python source Package
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/A7/50/wKioL1nkyfbSlNVwAAA1nWPRGTI282.png-wh_500x0-wm_ 3-wmp_4-s_2708420810.png "title=" 1.png "alt=" Wkiol1nkyfbslnvwaaa1nwprgti282.png-wh_50 "/>,
Choose python2.7 Here
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A7/50/wKioL1nkyi7QgvjpAAATQIGinrg545.png "title=" 2.png "alt=" Wkiol1nkyi7qgvjpaaatqiginrg545.png "/>
After entering the first source package will be available:
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/08/A0/wKiom1nkzQGQZdwsAAAW1E2Ukd0935.png-wh_500x0-wm_ 3-wmp_4-s_3529142595.png "title=" 3.png "alt=" Wkiom1nkzqgqzdwsaaaw1e2ukd0935.png-wh_50 "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/50/wKioL1nkymHQD0JXAAALlFQswog011.png "title=" 4.png "alt=" Wkiol1nkymhqd0jxaaallfqswog011.png "/>
When the download is complete, upload it to the server
(1) Unzip the source package
# TAR-ZXVF Python-2.7.14.tgz
(2) Installation python2.7
# CD Python-2.7.14 &&./configure && make all && make install && do clean && Make Distclean
(3) Check the installation
# /usr/local/bin/python2.7-v
(4) Establish a soft connection, using the system default Python point
# mv/usr/bin/python/usr/bin/python2.6.6
# ln-s/usr/local/bin/python2.7/usr/bin/python
(5) Check again
# python-v
(6) Last note
# Vim/usr/bin/yum
Change the interpreter #!/usr/bin/python to #!/usr/bin/python2.6.6
This article is from the "Note space" blog, so be sure to keep this source http://286577399.blog.51cto.com/10467610/1973070
2. Install Python under Linux