Recently learn python, because learning is python3, but the current Linux system is the default version is Python2, so Baidu a bit, find a good way.
This method is applicable to other distributions of Ubuntu and Debian without testing. The normal situation is supported by the release version of Ubuntu and Debian development
Open the terminal by entering the following two commands:
sudo update-alternatives--install/usr/bin/python python/usr/bin/python2
sudo update-alternatives--install/ Usr/bin/python Python/usr/bin/python3 150
And then enter the terminal:
Python
If correct, the Python version should now switch to the default Python3.
If you need to switch back to Python you only need to enter in the terminal:
sudo update-alternatives--config python
And then select the Python version you want, enter the serial number and return
Because many of the system's programs depend on Python2, if you need to upgrade your system or install system updates, it is recommended that you switch to the default version of the system first Python2 or you may have dependencies that cannot be installed.
View Original: https://www.aizheteng.net/ubuntu-python-version.html