Python 3 is pre-installed on most Ubuntu versions, but you may need to install additional tools.
Check Version
python3 --versionInstall pip
apt install python3-pip python3-venv -yCreate a Virtual Environment
python3 -m venv /opt/myproject/venv\nsource /opt/myproject/venv/bin/activate\npip install flask # Example\ndeactivateInstall Specific Version
Use the deadsnakes PPA for other Python versions:
add-apt-repository ppa:deadsnakes/ppa\napt update\napt install python3.12 python3.12-venv -y