Sandbox99 Chronicles

Installing Python 3.10.12 on Kali Linux: A Safe, Side-by-Side Setup Guide

python3.10 installation

Written by Jose Mendez

Hi, I’m Jose Mendez, the creator of sandbox99.cc. with a passion for technology and a hands-on approach to learning, I’ve spent more than fifteen years navigating the ever-evolving world of IT.


Published Jul 16, 2025 | Last updated on Jul 16, 2025 at 11:30AM

Reading Time: < 1 minute

🧩 Introduction

While Kali Linux often ships with the latest version of Python pre-installed, certain tools and projects may require compatibility with older versions. In this quick guide, we’ll walk through the process of installing Python 3.10.12 alongside the system’s existing Python (e.g., Python 3.13.5), without causing conflicts. By building Python from source and installing it into a custom directory, you maintain full control over version usage—ideal for virtual environments, scripting needs, or legacy tool support.

āœ… Step-by-Step Guide to Install Python 3.10.12 on Kali Linux

1. Install Build Dependencies

sudo apt update
sudo apt install -y build-essential libssl-dev zlib1g-dev \
  libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev \
  libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev \
  tk-dev uuid-dev libffi-dev wget

2. Download Python 3.10.12 Source

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz
sudo tar xvf Python-3.10.12.tgz
cd Python-3.10.12

3. Compile Python

sudo ./configure --enable-optimizations --prefix=/opt/python-3.10
sudo make -j$(nproc)
sudo make altinstall

Note: make altinstall prevents overwriting /usr/bin/python.

4. Verify Installation

/opt/python-3.10/bin/python3.10 --version

5. (Optional) Create a Symlink

sudo ln -s /opt/python-3.10/bin/python3.10 /usr/local/bin/python3.10

6. (Optional) Create Virtual Environments with Python 3.10

sudo apt install python3-venv     # Install Python3 virtual environment
/opt/python-3.10/bin/python3.10 -m venv ~/venvs/py310
source ~/venvs/py310/bin/activate # Activate Virtual Environment
deactivate                        # Exit Virtual Environment

šŸ Final Thoughts

Installing Python 3.10.12 alongside newer versions on Kali Linux is both safe and practical when done with care. This method ensures your system remains stable while giving you the flexibility to run older Python-based applications or create isolated environments. Whether you’re testing legacy code, using a specific library version, or learning Python version management, having multiple Python versions at your disposal can significantly improve your development workflow.

Calendar

September 2025
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930  

Related Post

How to Add AppImage Applications to the XFCE4 Menu

How to Add AppImage Applications to the XFCE4 Menu

āœļø Brief Introduction Managing applications on Linux can sometimes feel fragmented, especially when dealing with portable packages like AppImage that don’t integrate into the desktop menu by default. Unlike .deb or .rpm packages, AppImages run as standalone...

read more