Upgrade python 2.7 to 3.6 and 3.7 in Ubuntu

Image for post
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.

This PPA contains more recent Python versions packaged for Ubuntu. Install ppa by running the following command.

$ sudo add-apt-repository ppa:deadsnakes/ppa

Now, update your packages by running the following command.

$ sudo apt-get update

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 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.

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store