Install Python 3.10 on Ubuntu 22.04|20.04|18.04

For this tutorial, we will install Python 3.10 from the deadsnakes PPA.

sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.10 python3.10-dev python3.10-venv

# To check if the install is successful
python3.10 --version

If you get this error ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/ , that means you need to re-install pip that matched the new python

curl -sS | python3.10

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *