Install new version of Python and virtualenv using that version on Ubuntu


sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo apt install python3.9-dev
sudo apt install python3.9-distutils
sudo apt install python3.9-venv

From directory in which we want to install virtual env:

python3.9 -m venv env
Notes 

See also