Python is considered to be object-oriented, interpreted and high-level programming language along with dynamic semantics. It is beautiful for rapid app development. This tutorial is all about how to install Python 3.7 in Ubuntu 18.04, 19.04 and 19.10. It is used as the glue or scripting language to connect existing components all together due to its high built-in data structures all combined with the dynamic building and dynamic typing.
Python comes with a simple yet easy to learn syntax that is used to emphasise readability and thus reduce the cost of the program maintenance. Moreover, it is also used to support packages and modules that are used to encourage code reuse and modularity. The best part is that the extensive standard library and python interpreter is present in binary or source without any penny for all the major platforms and thus can be distributed freely.
Today programmers get in love with python due to its increased productivity that it provides. As it does not have any compilation step, therefore, the edit-test-debug is very fast. Debugging Python programs is very easy: any bug or lousy input shall not cause a segmentation fault.
However, if the interpreter finds an error, then it raises an exception. If the defence is not caught, then the interpreter prints a stack trace. The source-level debugger can allow inspection of a global and local variable, setting breakpoints, evaluation of arbitrary expressions, stepping through the code a line at a time and much more.
The debugger is therefore written in python and testifies to python’s introspective power. Moreover, another way in which you can debug a program is by adding a few print statements to the source: the fast edit-test-debug cycle makes such a practical approach very useful.
How to Install Python 3.7 in Ubuntu 16.04, 18.04, 19.04 and 19.10
Now let’s see how you can install the latest Python 3.7.3 in Ubuntu 18.04 LTS through PPA. The Ubuntu 16.04 by default carries both python 2.7 and 3.5. You can install the Python 3.7 along with them through a third party PPA by following the steps below
- In the first step, you need to open the terminal by pressing Ctrl + Alt +T, or you can search for the terminal from the app launcher. Once it runs, you need to run the following command to add the PPA
sudo add-apt-repository ppa:jonathonf/python-3.6
Keep in mind to type in your password for when it asks and then hit the enter button
- After this you need to check the updates and then install python 3.7 through the following commands:
sudo apt-get update sudo apt-get install python3.7
To use python3, you need to use the newly installed python 3.7 in spite of the default 3.5 release. For this, you need to run the following commands.
sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.5 1sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.6 2
Finally, you need to switch between the two python versions for python3 by running the following command:
sudo update-alternatives –config python3
After selecting the version 3.7, you need to run the following command:
Python V -3
Keep in mind that due to a particular bug the Gnome terminal would not be able to launch after step 3 thus a workaround is running the following commands to recreate the symlink.
sudo rm /usr/bin/python3sudo ln -s python3.5 /usr/bin/python3
Why have Python 3.7 Installed?
- Python in programming comes with the following benefits·
- It comes with the presence of third-party modules
- It comes with extensive support libraries
- Community development and open source
- It comes with an easy to learn and It comes along with user-friendly data structures
- It comes with speed and productivity.
Recommended Articles for Ubuntu:
- Top 8 Best GTK Themes for Ubuntu 19.10.
- 10 Ubuntu Terminal Commands and Shortcuts.
- MacBuntu 19 Transformation Pack Download for Ubuntu.
Have you Installed Python 3.7?
This article was all about teaching you how to install python 3.7 in Ubuntu 18.04, 19.04 and 19.10. We have given all the Linux commands that you will require to complete the python installation.