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.xz
3. Create directory--python3.5 under/usr/local path, install directory for 4th step
$mkdir/usr/local/python3.5
4. Compiling the installation
$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
1 backing up python
mv/usr/bin/python/usr/bin/python2.6.6
2 Modifying a soft connection
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
Centos Python2 upgrade to Python3