install GCC readline* and so on, or it will go wrong.
Yum install gcc readline*-y
1. From the Python website to the package that gets Python3, switch to directory/USR/LOCAL/SRC
#wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.5.1/PYTHON-3.5.1.TAR.XZ
2. Extract the following command using the command:
1 xz-d python-3.5.1.tar.xz2 tar-xf Python-3.5.1.tar
3. Create directory--python3.5 under/usr/local path, install directory for 4th step
$mkdir/usr/local/python3.5
4. Compile the installation (pip-7.1.2 will be installed automatically)
$CD/usr/local/src/python-3.5.1#./configure--prefix=/usr/local/python3.5#make all#make install#make clean#make Distclean
5. Enter the absolute path of the installation to check if the installation is successful
$/usr/local/python3.5/bin/python3.5-v Python 3.5.1
6. View the environment variables, start Python by default in the order of path to find, in/usr/bin python at this time is Python2.6.
$echo $PATH/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/gordon/bin
7. Modify soft connection, point to python3.5 when starting Python
Backup pythonmv/usr/bin/python/usr/bin/python2.6.6 sudo ln-s/usr/local/python3.5/bin/python3/usr/bin/python
8. Verify that python3.5 is started by default
$ python-v Python 3.5.1
9. After the upgrade of Python, Yum is not working, need to modify/usr/bin/yum, instead use python2.6.6
#!/usr/bin/python2.6.6
Python2 Upgrade to Python3