Upgrade python 2.7 to 3.6 and 3.7 in Ubuntu

Upgrade python 2.7 to 3.6 and 3.7 in Ubuntu

Image for post

You should use Python 3 going forward. As of January 2020, Python 2 will be in EOL (End Of Life) status and receive no further official support. After that date, there will be no further updates nor bugfixes. Since this end-of-life date has been planned for nearly a decade (the first end-of-life date was slated to happen in 2014, and was pushed back to 2020), and nearly all popular libraries have already ported their code, Python 2.x is well on its way to obsolescence. As such, we can only recommend learning and teaching Python 3. Now, Python 2.x is legacy but Python 3.x is the future.

Now, I think you should have to upgrade your python versions.

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 packeges

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

PiP installation

Install pip by running the following command.

$ sudo apt install python3-pip

Set priority

$ 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 can use python 2.7, 3.6 and 3.7 in your machine.

Feel free to ask any questions or queries in the comment section or you can ping me on Facebook.

2

No Responses

Write a response