Install Python 3.7 on Ubuntu 18

Here is a quick guide describing how to install Python 3.7 on Ubuntu 18 and make it the default version.

Before deploying your code into production you will need an environment to develop, test, and show off your project. While it may not be the first choice for a production server, Ubuntu 18 LTS is a great OS for developers. It offers the Gnome Desktop, live updates and many native plugins for common hardware. Some distributions ship with Python 2.7 and 3.7 will need to be installed.

Keep up to date with Python 3.7.

Starting January 1st 2020, Python 2.7 will reach end of life. You may as well start now! 3.7 adds new features and modules including the __future__ module for backward compatibility and using UTF 8 by default.

$ sudo apt install python3.7
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

Check your version with the following command

$ python -V
Python 3.7.1

Leave a comment