Skip to content

Instantly share code, notes, and snippets.

@jcopps
Last active August 28, 2019 07:11
Show Gist options
  • Save jcopps/2a2fb77e40cf88b7f312cecebc16c21f to your computer and use it in GitHub Desktop.
Save jcopps/2a2fb77e40cf88b7f312cecebc16c21f to your computer and use it in GitHub Desktop.
Switching between python2 and python3

Creating an alias will not be the best way to do it.

Using update-alternatives

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2

sudo update-alternatives --config python Enter 2 for Python 2.7.

By this way, one can select and its set across users and groups.

Use /usr/local/bin/supervisorctl restart all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment