Get the Latest Python on Linux

Windows Articles

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...

How to install Teamviewer on Ubuntu 20.04?

Hi, folks. This will be a short and very simple post in which you will learn how to install TeamViewer on Ubuntu...

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

Python is one of the most popular programming and scripting languages for all purposes. There are a number of tools you are working with that depends on Python. It’s so common and powerful that all the Linux distros come up with a pre-installed version of Python.

Today, let’s have a look at getting the latest version of Python in our Linux distro.

Installing Python

There are 2 available ways you can get Python – from the repo of the distro and building from the source. Some distros like Ubuntu, Debian, and Fedora etc. comes up with Python in their software repository. In the case of others, it’s the best to install Python from source.

Installing from distro repository

Run the following commands according to your Linux distro –

  • Ubuntu
sudo apt update && sudo apt upgrade -y

# Python 3
sudo apt install python3
OR
sudo apt install python3.7

# Python 2
sudo apt install python

  • Debian
sudo apt-get install python3
  • OpenSUSE
sudo zypper install python3
  • Fedora
sudo dnf install python37
  • Arch Linux
sudo pacman -S python

Installing Python from source

At first, make sure that your system has all the required dependencies to build Python from source –

  • Ubuntu
sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev

 

 

  • Debian
sudo apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev
  • OpenSUSE
sudu zypper install -t pattern devel_C_C++
  • CentOS
sudo yum update
sudo yum -y groupinstall development
sudo yum -y install zlib-devel

Now, download the latest source package of Python –

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz

Extract the archive –

tar -xvf Python-3.7.0.tar.xz

Build the source –

./configure --enable-optimizations --with-ensurepip=install
make -j4
make test

Install the package –

sudo make altinstall

Testing Python

Depending on the version you installed, run the following command(s) to verify that Python is available system-wide.

python --version
OR
python3 --version

Voila! Python is installed successfully!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to activate the automatic screen saver in Windows 10

Hello! Undoubtedly the time we spend in front of a computer has grown lately. In fact, in these times of pandemic, more...

How to install Teamviewer on Ubuntu 20.04?

Hi, folks. This will be a short and very simple post in which you will learn how to install TeamViewer on Ubuntu...

OpenSUSE 15.2 available

Well, another one has come into the family. A new version of OpenSUSE has recently been released. The community distribution under the...

How to install and configure Vagrant in Windows 10

Hello! Vagrant is a free, multi-platform command-line tool, which makes it easy to create reproducible and shareable development environments. Additionally, it creates...

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...