How to Install Python 3 on Kali Linux
Last Updated :
01 Mar, 2024
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
Method 1 : Using APT package manager
Step 1 : Update package list
To make sure we are getting latest version of python, update package list using apt update command.
sudo apt update -y
updating package listStep 2 : Install Python 3
Once repositories are up to date, we will install python using apt install command.
sudo apt install python3 -y
installing python using apt commandStep 3 : Verify installation
Once, installation is done, verify installation using python --version command.
python --version
verifying installation
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 dependenciesStep 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 packageStep 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 commandStep 4 : Navigate to the extracted directory
Once extracted, navigate to extracted directory using cd command.
cd Python-3.12.2
navigating to Python directoryStep 5: Configure and build
Once we are in extracted python directory, use following commands to make configurations and installation.
./configure
configuring python for installationOnce configuration is done, we will install python with make install command.
sudo make install
installing pythonStep 6 : Verify installation
Once, installation is done, verify installation using python --version command.
python --version
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.
Similar Reads
How to Install Python on Linux
This guide explains how to install Python on Linux machines. Python has become an essential programming language for developers, data scientists, and system administrators. It's used for various applications, including web development, data science, automation, and machine learning.This comprehensiv
15+ min read
How to Install Python-sh on Linux?
In python, the sh package is a full-fledged sub-process replacement for Python 2.6 - 3.8, PyPy, and PyPy3 that allows you to call any program as if it were a function. So, in this article, we will be installing the sh package in Python on Linux operating system. Installing Sh package on Linux using
1 min read
How to Install python-docx on Linux?
Word documents include formatted text wrapped in three object levels: Run objects at the lowest level, Paragraph objects at the intermediate level, and Document objects at the top level. As a result, we are unable to work with these documents using standard text editors. However, we may use the Pyth
2 min read
How to Install Python-Amara on Linux?
Amara is a Python library for XML processing in a Python environment, designed to balance the native idioms of Python with the native character of XML. Amara is a cross-platformed library that works on Windows, Linux, and macOS. So in this article, we will be installing the Amara package in Python o
1 min read
How to Install python-kinterbasdb on Linux?
In this article, we will be looking at the stepwise procedure to install the python-kinterbasdb for Python in Linux. KInterbasDB is a Python DB API 2.0 module for the relational databases Firebird and Interbase. It also exposes most of the native client API of the database engine, including two-phas
2 min read
How to Install Git on Kali Linux
Git is an important version control system that is renowned for its reliability and cooperation capabilities. The process of installing Git on Kali Linux is straightforward and efficient, guaranteeing that it works seamlessly with your development process. We'll carefully walk you through each step
7 min read
How to Install Tor Browser on Kali Linux
In todayâs digital age, online privacy and anonymity are more important than ever. For those who prioritize security, Tor Browser stands out as a powerful tool designed to protect your identity and keep your browsing activities private. If youâre running Kali Linux, a specialized operating system ta
6 min read
How to Install Python-USPP on Linux?
Python-USPP is a multi-platform Python library that allows communication between Python programs and USPP devices. This library is written in Python itself. It supports Windows, Linux, and MacOS. In this article, we will learn how to install this library in the Linux operating system. Python USPP in
3 min read
How to Install Python docutils on Linux?
Docutils is an open-source text processing system. It is written in Python language. It is used to process simple text or plaintext documents into some useful formats like LaTex, HTML, OpenDocument, XML, etc. It is easy to use and easy to read. It is available for operating systems like, Windows, ma
2 min read
How to Install Kali Linux on Windows?
Kali Linux is an open-source Linux distribution based on Debian, designed for sophisticated penetration testing and security auditing. Kali Linux includes hundreds of tools for diverse information security activities such as penetration testing, security research, computer forensics, and reverse eng
2 min read