
Using GAU for Recon: Get All URLs Like a Pro
June 18, 2025
How to Compress and Archive Files Using the tar Command in Linux
June 19, 2025How to Install Python on Kali Linux
Kali Linux typically comes with Python pre-installed, especially on full desktop images. But if you’re running a minimal version (like on a VPS or Docker container), or just want to make sure you have the latest version, here’s how to install or upgrade it.
1. Check if Python is Installed
python3 --version
If you see something like Python 3.11.2
, you’re good. Otherwise, proceed below.
2. Install Python 3
sudo apt update sudo apt install python3 -y
This installs the latest Python 3 package available via APT. Most tools will work fine with this version.
3. Add pip (Python Package Installer)
sudo apt install python3-pip -y
pip
lets you install Python modules like requests, Flask, or pwntools for CTFs. Check version with:
pip3 --version
The PyPA recommended tool for installing Python packages: PIP
4. Optional: Install Python Virtual Environments
sudo apt install python3-venv -y
This is useful for creating isolated Python environments when testing tools or writing scripts.
5. Verify Everything Works
You can test if Python is installed and working using either a quick one-liner or by launching the interactive shell.
Option 1: Run a one-liner directly from the terminal
python3 -c 'print("Hello Kali!")'
If it prints Hello Kali!
, Python is working correctly.
Option 2: Enter the interactive Python shell
python3
At the >>>
prompt, type:
print("Hello Kali!")
You should see:
Hello Kali!
To exit the Python shell, type:
exit()
If you see output, Python is now working fine.
Optional: Clean Uninstall and Reinstall
If things are still broken, you can try fully removing Python and pip, then reinstalling them from scratch:
sudo apt remove --purge python3 python3-pip sudo apt install python3 python3-pip
⚠️ Be careful: some system tools depend on Python, so don’t remove it unless you know what you’re doing or you’re on a minimal/test install.
Ready for a reliable, high-performance VPS at an unbeatable price? We host our own Kali labs on Hostinger: 4 vCPU, NVMe storage, 16 GB RAM and 16 TB bandwidth, backed by 24/7 support and a 30-day money-back guarantee. You’ll save up to 20% when you lock in a 24-month plan. Grab a Hostinger VPS using this referral link and support our content.
👉 Claim your Hostinger VPS (from only US$ 9.99/mo)