Python is one of the most popular programming languages in the world. With its simple and easy to learn syntax, Python is a great choice for beginners and experienced developers. Python is quite a versatile programming language. It can be used as a scripting language, to build games, develop websites, create machine learning algorithms, and analyze data.
Python 3.7 includes many new features such as postponed evaluation of type annotations, support for data classes and context variables, customization of access to module attributes, and more.
This tutorial describes two ways of installing Python 3.7 on Ubuntu 18.04: By using the standard
apt tool from the deadsnakes PPA, and by building from the source code.
The same steps apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint, and Elementary OS.
You’ll need to be logged in as root or user with sudo access to be able to install packages on your Ubuntu system.
Installing Python 3.7 on Ubuntu with apt is a relatively straightforward process and will only take a few minuts:
Start by updating the packages list and installing the prerequisites:
sudo apt update sudo apt install software-properties-common
Next, add the deadsnakes PPA to your sources list:
sudo add-apt-repository ppa:deadsnakes/ppa
When prompted press
Enter to continue:
Press [ENTER] to continue or Ctrl-c to cancel adding it.
Once the repository is enabled, install Python 3.7 with:
sudo apt install python3.7
At this point, Python 3.7 is installed on your Ubuntu system and ready to be used. You can verify it by typing:
In this section, we’ll show you how to download and compile Python 3.7:
First, update the packages list and install the packages necessary to build Python source:
sudo apt update sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev wget libbz2-dev
Download the latest release’s source code from the Python download page using the following wget command:
At the time of writing this article, the latest release is
Once the download is complete, extract the gzipped tarball:
tar -xf Python-3.7.4.tgz
Next, navigate to the Python source directory and run the
configure script which will perform a number of checks to make sure all of the dependencies on your system are present:
cd Python-3.7.4 ./configure --enable-optimizations
--enable-optimizations option will optimize the Python binary by running multiple tests. This makes the build process slower.
Start the Python build process using
make -j 8
For faster build time, modify the
-j flag according to your processor. If you do not know the number of cores your processor, you can find it by typing
nproc. The system used in this guide has 8 cores, so we are using the
When the build is done, install the Python binaries by running the following command:
sudo make altinstall
Do not use the standard
make install as it will overwrite the default system python3 binary.
That’s it. Python 3.7 has been installed and ready to be used. Verify it by typing:
The output will show the Python version:
How to Generate PDF in React using jsPDFIn this tutorial, we are going to look a...
How to count all elements or values in an array in PHPUse the PHP count() or si...
Laravel Passport - Create REST API with authenticationToday, in this tutorial we are share wit...
React CRUD Example using MongoDB | Express | React | NodeJsToday, I am going to teach you how to&nb...