How to modify python2/3 to the default version

Based on the update-alternatives command. This method is a system-level modification.
Just execute the following two commands 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 need to change back to the python2 default, enter:

sudo update-alternatives --config python

or

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 150
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100

complete.

Guess you like

Origin blog.csdn.net/qq_42244167/article/details/132603404