How To Update Python In Ubuntu
Still got Python 2.x in your Ubuntu system, and want to know how to upgrade to the latest version of Python, you’ve come to the right place. This article will help you to update Python in Ubuntu.
Step 1: Install PPA
This PPA contains more recent Python versions packaged for Ubuntu. Install ppa by running the following command.
$ sudo add-apt-repository ppa:deadsnakes/ppa
Step 2: Update packages
Now, update your packages by running the following command.
$ sudo apt-get update
Step 3: Upgrade python 2.x to python 3.x
Before install 3.7, we should have to install python 3.6 by running the following command.
$ sudo apt-get install python3.6
$ sudo apt-get install python3.7
Install pip by running the following command.
$ sudo apt install python3-pip
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
Now, you are all set with the new Python version in your Ubuntu system and you can use python 2.7, 3.6 and 3.7 in your machine.
Please login to comment
View all comments