upgrade python version linux code example
Example 1: command to upgrade python version
python -m pip install pip
python -m pip install –upgrade pip
python -m pip install --upgrade pip
Example 2: how to install python3 in ubuntu
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.8
Example 3: how to change python version on linux
ls /usr/bin/python*
alias python='/usr/bin/python3.x'
. ~/.bashrc
python --version
Example 4: update python ubuntu
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python3.7
Example 5: how to upgrade 3.6 to 3.7 on linux
sudo apt-get install python3.7
Example 6: update python ubuntu
$ sudo apt update -y
$ sudo apt install python3.7