Skip to content

Instantly share code, notes, and snippets.

@amoretspero
Created August 9, 2020 10:41
Show Gist options
  • Save amoretspero/ac0af3db81609f9939c971a43c52e496 to your computer and use it in GitHub Desktop.
Save amoretspero/ac0af3db81609f9939c971a43c52e496 to your computer and use it in GitHub Desktop.
Upgrade python version on ubuntu (>= 18.04)
# 0. Get official distribution. Substitue 'x' with desired version.
sudo apt-get install python3.x
# 1. Get all installed python3 distributions
ls -alh /usr/bin | grep python3
# 2. Add installed python3 version to update-alternatives
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.x
# 3. Configure update-alternatives.
sudo update-alternatives --config python3
# 4. If using virtualenv, update its python version
python3 -m virtualenv -p python3.x <your_virtualenv_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment