1. Centos7 initial installation of the Python version is 2.7.5
2. Download the latest python3.5.2, unzip to/USR/LOCAL/SRC
3. Configure, compile, test, install (according to the software Readme instructions)
./configure--prefix=/usr/local/python3.5.2
Make
Make Test
Make install
4. Back up the original Python file (through the command ls-l/usr/bin/python can see the python file Soft link point to the file , similar to window shortcut)
mv/usr/bin/python/usr/bin/python2.7.5
5. Create a "shortcut":
Ln-s/usr/local/python3.5.2/bin/python3.5/usr/bin/python
6. Modify Yum:
Since Yum is using the python2.x version, all upgrades result in Yum not being used, although the original python2.x still exists;
Just modify the execution version of the Yum file to:
Change the #!/usr/bin/python of the file head to #!/usr/bin/python2.7.5 save exit;
Reference:
Http://jingyan.baidu.com/album/86112f137e502a2736978763.html?picindex=1
CentOS System python2.x Upgrade python3.x