How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
The Wayback Machine - http://web.archive.org/web/20220628190256/https://www.linuxcapable.c…
LinuxCapable Menu
Home » Debian » How to Install Python 3.8 on Debian 11 Bullseye
How to Install Python 3.8 on Debian 11 Bullseye
Last Updated on: Wednesday, October 6, 2021 by Joshua James
By default, Debian 11 Bullseye does not come with Python 3.8 in its repositories, unlike
some other distributions such as Ubuntu. Python 3.9 is now the latest stable feature
release series of Python 3, with Python 3.10 still in beta.
To run some applications or frameworks on Debian 11, you may need to install Python 3.8
on your system, for example, using the Swift programming framework given it built to
utilize Ubuntu’s LTS versions that still run the older versions of Python by default. Python
3.8 is currently being worked on for security releases, but it is advisable to upgrade to
newer versions if you are developing applications.
In the following tutorial, you will learn how to download the latest version of Python 3.8,
compile and make it on your Debian 11 Bullseye operating system.
Table of Contents
1. Prerequisites
2. Updating Operating System
3. Root or Sudo Access
4. Install Python 3.8
5. Create a Virtual Environment
6. Python 3.8-PIP
7. Comments and Conclusion
Prerequisites
• Recommended OS: Debian 11 Bullseye
• User account: A user account with sudo privilages or root access (su command).
• Required Packages: wget
Updating Operating System
Update your Debian 11 operating system to make sure all existing packages are up to
date:
1 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
Click To Copy!
sudo apt update && sudo apt upgrade
Root or Sudo Access
By default, when you create your account at startup with Debian compared to other
distributions, it does not automatically receive sudoers status. You must either have access
to the root password to use the su command or visit our tutorial on How to Add a User
to Sudoers on Debian.
Install Python 3.8
Once you have got the download link, use the wget command to download the Python
3.8 archive:
Click To Copy!
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz
Extract the Python archive. Remember, change the version number if you downloaded a
newer one:
Click To Copy!
tar -xf Python-3.8.12.tar.xz
mv Python3.8.12 /opt/Python3.8.12
Now install the dependencies required to install Python 3.8:
Click To Copy!
2 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
sudo apt install build-essential zlib1g-dev libncurses5-dev
libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev
libffi-dev curl libbz2-dev -y
Navigate to the directory and run the ./configure –enable-optimizations command:
Click To Copy!
cd /opt/Python3.8.12/
./configure --enable-optimizations --enable-shared
Note, The script performs several checks to make sure all of the dependencies on your
system are present. The ./configure –enable-optimizations will optimize the Python
binary by running multiple tests, which will make the build process slower.
Now that you have built and configured the environment, it is time to compile it with the
command make.
Click To Copy!
make
A handy trick is to specify the -j <number of cpu> as this can significantly increase
compiling speed if you have a powerful server. For example, the LinuxCapable server has 6
CPUs, and I can use all 6 or at least use 4 to 5 to increase speed.
Click To Copy!
make -j 6
Once you have finished building, install Python binaries as follows:
Click To Copy!
sudo make altinstall
Note, it’s advised to use the make altinstall command NOT to overwrite the default
Python 3 binary system.
3 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
Next, after the installation, you need to configure the dynamic linker run-time bindings:
Click To Copy!
sudo ldconfig /opt/Python3.8.12
Note, do not skip this, or you will face issues. You will also need to replace the path with
your directory name and version.
Confirm that Python 3.8 is installed and the build version by running the following
command:
Click To Copy!
python3.8 –version
Example output:
Click To Copy!
Python 3.8.12
Create a Virtual Environment
Python’s venv module is a virtual environment is a Python environment such that the
Python interpreter, libraries, and scripts installed into it are isolated from those established
in other virtual environments, and (by default) any libraries installed on your operating
system, for example, those that are installed on your Ubuntu operating system to avoid
clashing and disturbing your production environments.
To make sure Python 3.8 is installed correctly and functioning, create a quick Python
project as follows.
First, create the project directory and navigate to it:
4 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
Click To Copy!
mkdir ~/test_app && cd ~/test_app
Now inside the project root directory, run the following command to create a virtual
environment, for the test name it test_app:
Click To Copy!
python3.8 -m venv test_app_venv
Next, activate the virtual environment as follows:
Click To Copy!
source test_app_venv/bin/activate
After starting the virtual environment you will now be in the shell prompt terminal. You will
notice the name of your environment will be prefixed.
Example:
Click To Copy!
(test_app_venv) root@debian:~/test_app#
To exit the virtual environment, use the following command:
Click To Copy!
deactivate
Python 3.8-PIP
5 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
By default, PIP 3.8 should be installed. For those with PIP issues, an alternative method is
to install the package manager manually.
This can be done in several ways. One of the most common is as follows.
Log back into your environment, then download get-pip.py using the wget command.
Click To Copy!
wget https://bootstrap.pypa.io/get-pip.py
Next, install the file downloaded.
Click To Copy!
python3.8 get-pip.py
Once installed, it is a good idea to check for upgrades.
Click To Copy!
python3.8 -m pip install --upgrade pip
Now verify the PIP 3.8 version installed:
Click To Copy!
(test_app_venv) root@debian:/opt/Python3.8.12# pip3.8 --version
pip 21.2.4 from /opt/Python3.8.12/test_app_venv/lib/python3.8/site-
packages/pip (python 3.8)
Comments and Conclusion
You have learned how to install Python 3.8 for Debian 11 Bullseye in the tutorial and create
6 of 7 25/06/2025, 13:30
How to Install Python 3.8 on Debian 11 Bullseye - LinuxCapable http://web.archive.org/web/20220628190256/https://linux...
an immediate virtual environment. Overall, it is advised if you are in development to move
to Python 3.9 in the future, but using Python 3.8 is still safe as the Python Software
Foundation is maintaining it.
Debian
Debian 11 Bullseye
How to Install Linux Malware Detect (Maldet) on Rocky Linux 8
How to Install Fail2ban with Firewalld on AlmaLinux 8
Follow LinuxCapable.com!
Like to get automatic updates? Follow us on one of our social media accounts!
Facebook Twitter Reddit
Contact Us Cookie Policy Disclaimer Privacy Policy Terms Of Use
© 2021 - 2022 LinuxCapable all rights reserved.
All logos, trademarks and registered trademarks are the property of their respective owners.
This website is for educational purposes only. No warranty or compensation is given for any loss
of data or hardware.
7 of 7 25/06/2025, 13:30