2.2 C
Amsterdam
Saturday, December 5, 2020

Get the Latest Python on Linux

Must read

How to change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...

Install Fossil on Linux – An alternative to Git

Hello, friends. In this post, we will talk about a serious alternative to Git. In a few words, we'll show you how to install...

How to backup and restore BCD in Windows 10

Hi! Boot Configuration Data (BCD) is a set of data where the system boot information is stored. In addition, from there the operating systems...

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 change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...

Install Fossil on Linux – An alternative to Git

Hello, friends. In this post, we will talk about a serious alternative to Git. In a few words, we'll show you how to install...

How to backup and restore BCD in Windows 10

Hi! Boot Configuration Data (BCD) is a set of data where the system boot information is stored. In addition, from there the operating systems...

How To Install and Configure Master BIND DNS Server On Ubuntu 20.04

Today we are going to learn that how to install and configure Master BIND DNS server on Ubuntu 20.04. As you all know that...
x