Original link:
https://blog.csdn.net/qq_38742266/article/details/80838205
Both commands can be executed directly:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
If you want to switch to Python2, execute:
sudo update-alternatives --config python