How to change your default python version.
- Make sure python 3 is installed and up to date:
sudo apt-get update && sudo apt-get upgrade -y
- Set up the alternative versions (Debian or Ubuntu):
sudo update-alternatives --install /usr/bin/python python /user/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /user/bin/python3.7 2
- To change versions use:
sudo update-alternatives --config python
If you want a simple command to swap versions use this little bash script!
Place it on your path for easy execution!