librarysteve / chpy

How to change your default python version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chpy 🐍

How to change your default python version.

  1. Make sure python 3 is installed and up to date:
sudo apt-get update && sudo apt-get upgrade -y
  1. 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
  1. 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!

About

How to change your default python version.

License:MIT License


Languages

Language:Shell 100.0%