Installing Python 3.8 on Debian 10

Building Python 3.8 on Debian is a relatively straightforward process and will only take a few minutes.

  1. Start by installing the packages necessary to build Python source:
Copysudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
  1. Download the latest release’s source code from the Python download page with wget or curl. At the time of writing this article, the latest release is 3.8.2:
Copycurl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
  1. When the download is complete, extract the tarball:
Copytar -xf Python-3.8.2.tar.xz
  1. Navigate to the Python source directory and run the configure script:
Copycd Python-3.8.2
./configure --enable-optimizations --enable-loadable-sqlite-extensions

The script performs a number of checks to make sure all of the dependencies on your system are present. The --enable-optimizations option will optimize the Python binary by running multiple tests, which will make the build process slower.

  1. Run make to start the build process:
Copymake -j 4

Modify the -j to correspond to the number of cores in your processor. You can find the number by typing nproc.

  1. Once the build is done, install the Python binaries by running the following command as a user with sudo access:
Copysudo make altinstall

Do not use the standard make install as it will overwrite the default system python3 binary.

  1. At this point, Python 3.8 is installed on your Debian system and ready to be used. You can verify it by typing:
Copypython3.8 --version
Python 3.8.2

source: https://linuxize.com/post/how-to-install-python-3-8-on-debian-10/

Answer from alex_noname on Stack Overflow
Top answer
1 of 1
35

Installing Python 3.8 on Debian 10

Building Python 3.8 on Debian is a relatively straightforward process and will only take a few minutes.

  1. Start by installing the packages necessary to build Python source:
Copysudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
  1. Download the latest release’s source code from the Python download page with wget or curl. At the time of writing this article, the latest release is 3.8.2:
Copycurl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
  1. When the download is complete, extract the tarball:
Copytar -xf Python-3.8.2.tar.xz
  1. Navigate to the Python source directory and run the configure script:
Copycd Python-3.8.2
./configure --enable-optimizations --enable-loadable-sqlite-extensions

The script performs a number of checks to make sure all of the dependencies on your system are present. The --enable-optimizations option will optimize the Python binary by running multiple tests, which will make the build process slower.

  1. Run make to start the build process:
Copymake -j 4

Modify the -j to correspond to the number of cores in your processor. You can find the number by typing nproc.

  1. Once the build is done, install the Python binaries by running the following command as a user with sudo access:
Copysudo make altinstall

Do not use the standard make install as it will overwrite the default system python3 binary.

  1. At this point, Python 3.8 is installed on your Debian system and ready to be used. You can verify it by typing:
Copypython3.8 --version
Python 3.8.2

source: https://linuxize.com/post/how-to-install-python-3-8-on-debian-10/

🌐
Linuxize
linuxize.com › home › python › how to install python 3.8 on debian 10
How to Install Python 3.8 on Debian 10 | Linuxize
March 2, 2020 - Python 3.8 is not available in the standard Debian 10 repositories. This tutorial covers how to install Python 3.8 on Debian 10.
Discussions

Installing python3.8 on Debian 10
which python3.8 Or type which python3 and press TAB to see options. More on reddit.com
🌐 r/linuxquestions
6
1
February 17, 2022
Is it safe to install python-3.8 on Debian 10
It may be safe to install the versioned packages but hexchat requires python3-dev (>= 3.8) and I don't recommend installing that. More on reddit.com
🌐 r/debian
14
3
August 17, 2020
How to install a specific python version on Debian 12?
Take a look at pyenv - should allow you to install multiple different versions without touching any standard system installation. It will compile the required version. You will need the usual tool chain installed. PS. https://www.carlpearson.net/post/20210822-debian-pyenv-poetry/ More on reddit.com
🌐 r/learnpython
8
3
July 6, 2023
Debian Bullseye "Could not import python modules: apt, apt_pkg. Please install python3-apt package."

The best solution is to run the playbook with increase verbosity so it can tell you the inside error

More on reddit.com
🌐 r/ansible
7
1
November 20, 2020
People also ask

Are there alternative methods for installing Python on Debian?

Yes, besides APT, you can also install Python from source or use third-party package managers like Conda. However, using APT is the recommended and simplest method for most users.

🌐
ultahost.com
ultahost.com › knowledge-base › install-python-on-debian
How to Install Python on Debian | Ultahost Knowledge Base
Which package manager should I use to install Python on Debian?

Debian systems typically use the Advanced Package Tool (APT) for package management. You can use APT to install Python.

🌐
ultahost.com
ultahost.com › knowledge-base › install-python-on-debian
How to Install Python on Debian | Ultahost Knowledge Base
What is Python?

Python is a high-level, interpreted programming language known for its simplicity and versatility. It's widely used for various purposes, including web development, data analysis, artificial intelligence, and more.

🌐
ultahost.com
ultahost.com › knowledge-base › install-python-on-debian
How to Install Python on Debian | Ultahost Knowledge Base
🌐
TecAdmin
tecadmin.net › install-python-3-8-ubuntu
How to Install Python 3.8 on Ubuntu, Debian and LinuxMint – TecAdmin
April 26, 2025 - This tutorial helped you for installing Python 3.8 on Ubuntu, Debian, and Linux Mint systems by compiling it from source code.
🌐
Reddit
reddit.com › r/linuxquestions › installing python3.8 on debian 10
r/linuxquestions on Reddit: Installing python3.8 on Debian 10
February 17, 2022 -

Preface: using Debian 10 on a Google Cloud VM

I just installed python3.8 using this site here: https://linuxize.com/post/how-to-install-python-3-8-on-debian-10/ . The install worked and can be confirmed checking the version. python3.8 --version = 3.8.2. After installation I'm left with a few questions and issues.

When checking /home/js04/usr/lib I see "python2", "python3", and "python3.7" but NOT "python3.8". However, when I navigate to /home/js04/.local/lib I see "python3.7" and "python3.8". Is this normal? Should "python3.8" be in /usr/lib?

Second, after installation I'm left with the folder "Python-3.8.2" and file "Python-3.8.2.tar.xz" in my home directory /home/js04. Can these be deleted for organizational reasons?

🌐
GitHub
gist.github.com › oshinko › 584122f8dc1a46c786f2703fed0aefaa
Install Python 3.8 from Source Code on Debian · GitHub
Install Python 3.8 from Source Code on Debian. GitHub Gist: instantly share code, notes, and snippets.
🌐
idroot
idroot.us › home › how to install python 3.8 on debian 10
How To Install Python 3.8 on Debian 10 - idroot
January 7, 2023 - In this tutorial we will show you how to install Python 3.8 on Debian 10 Buster, as well as some extra required package by Python
Find elsewhere
🌐
UltaHost
ultahost.com › knowledge-base › install-python-on-debian
How to Install Python on Debian | Ultahost Knowledge Base
April 13, 2024 - Want to harness the full potential of Python on Debian? Start your journey now with Ultahost’s Python hosting services! ... This command provides a list of all available Python versions and you can install any of them using the command: ... This will install Python version 3.8 in your Debian distribution.
🌐
Linux Today
linuxtoday.com › home › developer
How to Install Python 3.8 on Debian 11 | Linux Today
September 14, 2021 - 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.
🌐
Alchosting
my.alchosting.net › knowledgebase › 14 › How-to-Install-Python-3.8-on-Ubuntu-Debian-and-LinuxMint.html
How to Install Python 3.8 on Ubuntu, Debian and LinuxMint - ALC Hosting Networks
sudo apt-get install build-essential checkinstall sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \ libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev · Download Python source code using the following command from python official site.
🌐
Position Is Everything
positioniseverything.net › home › how to install python 3.8 on linux: a step-by-step guide
How to Install Python 3.8 on Linux: A Step-by-Step Guide - Position Is Everything
May 16, 2026 - This guide walks through the most practical ways to install Python 3.8 on popular Linux distributions, including Ubuntu, Debian, Fedora, CentOS/RHEL, Arch-based systems, and a universal source-build method that works almost anywhere.
🌐
SoByte
sobyte.net › post › 2022-03 › how-to-install-python-3-8-on-debian-10
How to install Python 3.8 on Debian 10 - SoByte
March 1, 2022 - Python 3.8 is not available in the standard Debian 10 repository. This tutorial describes how to install Python 3.8 on Debian 10.
🌐
Debian
packages.debian.org › python3.8
Client Challenge
May 5, 2022 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Linux Today
linuxtoday.com › home › how to install python 3.8 on debian 10
How to Install Python 3.8 on Debian 10 | Linux Today
June 22, 2021 - Learn how to install Python 3.8 on Debian 10 and how to create a virtual environment.
🌐
LinuxForDevices
linuxfordevices.com › home › ubuntu › installing latest python on debian/ubuntu using source
Installing Latest Python on Debian/Ubuntu using Source - LinuxForDevices
March 3, 2020 - ... Let’s check if the package was successfully installed. Run python3.8 -V in your terminal. If you get the below output, congratulations! You have successfully installed the latest version of Python in your Debian or other Linux system.
🌐
Webhosting UK
webhosting.uk.com › home › how to install python on debian 12: a step-by-step guide
How to install python on debian 12: A step-by-step guide
March 24, 2026 - Installing Python on Debian 12 is straightforward. Whether you need the latest version or an older release, this guide covers all the necessary steps. Setting up Python on a live server? For better control over your environment, consider using a Linux VPS with root access. If your version is different, change ‘3.8’ to match your installed version number.
🌐
TecAdmin
tecadmin.net › how-to-install-python-on-debian-12
How to Install Python on Debian 12 – TecAdmin
April 26, 2025 - Replace ‘3.8’ with your installed version number if it’s different. That’s it! You now know how to install Python from both the default repositories and external PPAs on Debian 12.
🌐
Debian
packages.debian.org › sid › python3.8
Debian -- Error
See our contact page to get in touch · Content Copyright © 1997 - 2025 SPI Inc.; See license terms. Debian is a trademark of SPI Inc. Learn more about this site
🌐
GitHub
gist.github.com › andybe › 4ab4a17ae47c1908cf8be8ec9a8a4eef
python 3.8 on debian buster · GitHub
python 3.8 on debian buster. GitHub Gist: instantly share code, notes, and snippets.
Top answer
1 of 2
10

As per the instructions on How to Install Python 3.8 on Ubuntu, Debian and LinuxMint – TecAdmin, try the following:

Prerequisites:

Install [and or update] the following packages; build-essential, checkinstall, libreadline-gplv2-dev, libncursesw5-dev, libssl-dev, libsqlite3-dev, tk-dev, libgdbm-dev, libc6-dev, libbz2-dev, libffi-dev, zlib1g-dev.

sudo apt install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

Thereafter, change directory (cd) to your opt folder [or any convenient folder] and download the python source code from python's server:

First change directory (cd) to the 'opt' folder:

cd /opt/

Download the source code

sudo wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz

Extract the [downloaded] source code files

sudo tar xzf Python-3.8.3.tgz

Change directory (cd) the Python Folder [created after the extraction]

cd Python-3.8.3

Compile the source code

sudo ./configure --enable-optimizations

then

sudo make altinstall

Once the compilation is completed, you can confirm that Python 3.8 has been installed successfully with:

python3.8 -V

You should see the response Python-3.8.3.

However, to precisely answer your question, python 3.8 isn't available via ubuntu official repos. You would have to add a PPA to get python 3.8 using sudo apt install [python3.x.x].

The process is described on How to Install Python 3.8 on Ubuntu 18.04 | Linuxize

Hope this helps and I hope I answered your question adequately.

2 of 2
0

It looks like Python 3.8 is already installed but not set as default. Python 3.7.6 is set as default.

Update default Python3 version by below command.

sudo update-alternatives --config python3

Choose Python 3.8 option and check Python version again.