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
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
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
Step 4 : Navigate to the extracted directory
Once extracted, navigate to extracted directory using cd command.
cd Python-3.12.2
Step 5: Configure and build
Once we are in extracted python directory, use following commands to make configurations and installation.
./configure
Once configuration is done, we will install python with make install command.
sudo make install
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
Contact Us