Skip to content

Instantly share code, notes, and snippets.

@ant1fact
Created February 20, 2022 12:33
Show Gist options
  • Save ant1fact/8fdacea1b925ec9219cb04467783b18c to your computer and use it in GitHub Desktop.
Save ant1fact/8fdacea1b925ec9219cb04467783b18c to your computer and use it in GitHub Desktop.
Install python3.10 as python on ubuntu 20.04
# Setup
sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
# Python 3.10
sudo apt install python3.10
sudo apt install python3.10-dev
sudo apt install python3.10-distutils
sudo apt install python3.10-venv
# Pip
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
echo 'export PATH=/home/<USER>/.local/bin:$PATH' >>~/.profile
source ~/.profile
pip install --upgrade pip
# Remap
sudo apt install python-is-python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
@ant1fact
Copy link
Author

Note: I used these commands in a clean Ubuntu 20.04 installation running on WSL2

@ant1fact
Copy link
Author

ant1fact commented Feb 6, 2023

# Setup
sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y

# Python 3.11
sudo apt install python3.11
sudo apt install python3.11-dev
sudo apt install python3.11-distutils
sudo apt install python3.11-venv

# Pip
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
echo 'export PATH=/home/${USER}/.local/bin:$PATH' >> ~/.profile
source ~/.profile
pip install --upgrade pip

# Remap
sudo apt install python-is-python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1

Updated for Python 3.11

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