Ubuntu 18.04

Python 3.8

apt-add-repository -y ppa:deadsnakes
apt update
apt install python3.8

update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
update-alternatives --config python