First install Ubuntu software properties package if it’s not already installed on your system.
sudo apt update
sudo apt install software-properties-common
After that run the commands to add the PPA.
sudo add-apt-repository ppa:deadsnakes/ppa
Finally, run the commands below to install Python 3.7
sudo apt update
sudo apt install python3.7
sudo apt install python3-pip