ubuntu 16.04 comes with two versions of python, a version 2, which uses python, and a version 3, which uses python3.
The version number of version 3 you get from a simple installation of python is python 3.5.
The py version can be viewed using the following command:
python3 --version
Because of the difference in version content/interface, etc., it is necessary to upgrade to a higher version as follows:
1. Install Python 3.7.
sudo apt-get install python3.7
2, in order to facilitate the use, it is recommended to create a soft connection
First remove the previous soft link:
sudo rm -rf /usr/bin/python3 sudo rm -rf /usr/bin/pip3
View the Python 3.7 installation path:
which python3.7 # Assume the return path is path
Then create a new soft connection:
#add softlinks for python3 sudo ln -s Python3.7Installation Path/python3.7 /usr/bin/python3 # Add pip3 softlink sudo ln -s Python3.7Installation Path/pip3.7 /usr/bin/pip3 #Test if the installation was successful python3 --version
This method also modifies the Python version that the default Python points to
To this point this article on ubuntu16.04 upgrade Python3.5 to Python3.7 method step by step article is introduced to this, more related Python3.5 upgrade to Python3.7 content please search for my previous articles or continue to browse the following related articles I hope that you will support me in the future!