Method:
1. Official website:http://www.python.org/download/
2, rz-y upload to Linux decompression TAR-XVZF python-3.5. 1.tgz Enter the directory CD python-3.5. 1/
3. Compile and install
./configure--prefix=/usr/python
TweenConfigureWhen the command finishes executing, it generates amakefile file, this makefile The main is the next make command. Open makefile linux need to follow makefile The order specified to build program component. Make command
After performing the make install command to this basic installation is complete
------------------------------------------------------------------------
After the installation is successful, the installation directory is/usr/python
The original python in the system is in/usr/bin/python, ls-l can see that Python is a soft link to the python2.7 in this directory
We can either delete this or create a new Python3 soft link, except that Python will change to Python3 when executed, or the Python script header declaration will be changed to #!/usr/bin/python3
In order to facilitate the suggestion to rename first, and then create a soft link on it, the previous program head does not have to change:
mv/usr/bin/python/usr/bin/ln-s/usr/python/bin/python3/usr/bin/python
Then enter Python to check the Python version
Linux installation Python 3