Python is a powerful programming language suitable for beginners and experts alike. This guide provides detailed instructions for installing Python on Debian 12, using both default repositories and external PPAs.
In this guide, you will learn to install Python on Debian 12.
Follow the steps:
- Update the Package List
Ensure your package list is up-to-date. Open the terminal and type:
sudo apt update
This command updates your local software repository index. - Check the Available Python Version
Verify the Python version available in the repositories:
apt show python3 - Install Python
To install Python, run:
sudo apt install python3
You will be prompted for your password to initiate the installation. - Verify the Installation
Confirm the installation by checking the Python version:
python3 –version - Installing Additional Python Versions via Deadsnakes PPA
If you need an older version, you can use the Deadsnakes PPA:- Install Required Software
sudo apt install software-properties-common - Add the Deadsnakes PPA
sudo add-apt-repository ppa:deadsnakes/ppa
Press [ENTER] to proceed. - Update the Package List Again
sudo apt update - Install the Desired Python Version for Python 3.8:
sudo apt install python3.8 - Confirm the Installation Check the installed version:
python3.8 –version
- Install Required Software
Troubleshooting Common Issues
If you encounter errors during installation, check the following:
- Ensure your system is fully updated.
- Verify your internet connection.
Conclusion:
Installing Python on Debian 12 is straightforward. Whether you need the latest version or an older release, this guide covers all the necessary steps.
If your version is different, change ‘3.8’ to match your installed version number. For Information, you can visit our knowledge base section.