How to install python3.8/3.7 on ubuntu 21.04

You could use the project Conda. Conda is for Python environments. Luckily you can choose the Python version you want to use. Check out at conda.io! Once you're in a Python environment, install any package by conda install PACKAGE. Official documentation: https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html

To create an environment, use conda create To create a Python 3.8 environment, use the python-variable, an example: conda create -n "name" python=3.8 #quotes not required Then: conda use "name" #quotes not required