Method 2 : Compiling from sources

Step 1 : Installing dependencies

In order to install python 3 from Tarball package, we will need to download required dependencies using apt install command as follows

sudo apt install build-essential zlib1g-dev libncurses-devlib libgdbm-dev libnss3 libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev -y

Installing dependencies

Step 2 : download archive

In this step, we will download official Tarball package from official python repository using wget command.

wget https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz

downloading Tarball package

Step 3 : Extract the archive

Once downloading is completed, we will extract the package using tar -xvf command.

tar -xvf Python-3.12.2.tgz

extracting downloaded archive using tar -xvf command

Step 4 : Navigate to the extracted directory

Once extracted, navigate to extracted directory using cd command.

cd Python-3.12.2

navigating to Python directory

Step 5: Configure and build

Once we are in extracted python directory, use following commands to make configurations and installation.

./configure 

configuring python for installation

Once configuration is done, we will install python with make install command.

sudo make install 

installing python

Step 6 : Verify installation

Once, installation is done, verify installation using python –version command.

python --version 

How to Install Python 3 on Kali Linux

Python 3 is a powerful and versatile programming language widely used for various tasks, from web development to data science, security automation, and AI and ML. Recent versions of Kali Linux come with Python 3 pre-installed. For some reason if you want a different version than the one already installed or you’re using an old version of Kali Linux which doesn’t have python 3 pre-installed. In this article, we will install Python 3 using two methods

Table of Content

  • Method 1 : Using APT package manager
  • Method 2 : Compiling from sources
  • How to Install Python 3 on Kali Linux – FAQs

Similar Reads

Method 1 : Using APT package manager

Step 1 : Update package list...

Method 2 : Compiling from sources

Step 1 : Installing dependencies...

How to Install Python 3 on Kali Linux – FAQs

How do I manage multiple Python versions on my system?...

Conclusion

In this article we have discussed two methods for installing Python 3 in Kali Linux. For most users, the recommended approach is to use the Kali repositories (using APT Package Manager) for ease of installation, compatibility, and regular security updates. However, if you have specific requirements or need to install a development version, compiling from source can be an option....

Contact Us