To install Python 3.8 on Ubuntu version 23

Open your terminal and run these commands:

Install build dependencies

sudo apt-get update

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
                        libreadline-dev libsqlite3-dev wget curl llvm \
                        libncurses5-dev libncursesw5-dev xz-utils tk-dev \
                        libffi-dev liblzma-dev python3-openssl git

Download and extract Python 3.8 source code

mkdir ~/python38
cd ~/python38
wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz
tar -xf Python-3.8.16.tgz

cd Python-3.8.16

Configure the build

./configure --enable-optimizations

Compile the source code

make -j$(nproc)

Install Python

sudo make install

Verify the installation

python3.8 --version

To create a virtual environment specify the Python version.

Example: python3.8 -m venv venv

Answer from GODFREY NDUNGU on askubuntu.com
🌐
Python
python.org › downloads
Download Python | Python.org
Python 3.13.9 Oct. 14, 2025 Download Release notes · Python 3.13.8 Oct.
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › starting › install3 › linux
Installing Python 3 on Linux — The Hitchhiker's Guide to Python
If you’re using another version ...ies-common $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update $ sudo apt-get install python3.8 · If you are using other Linux distribution, chances are you already have Python ...
Discussions

How to install python 3.8.12 on /usr/bin/python? - Stack Overflow
I want to install python 3.8.12 on my ubuntu . I followed this link: https://tecadmin.net/install-python-3-8-ubuntu/ and installed python in my Download folder and I can't find it at /usr/bin/pyth... More on stackoverflow.com
🌐 stackoverflow.com
How to Install Python 3.8 on LinuxMint
So whilst there aren't many breaking changes in 3.8, replacing the default version of python is not a recommenced thing to do as it might break some core parts of Linux Mint. Much better to use something like pyenv. More on reddit.com
🌐 r/linuxmint
9
35
October 16, 2019
How to install Python 3.8
I tried to install gensim using pip3 install -U gensim but it died with the message that python 3.8 is required. However, Rocky ships with only 3.6 as far as I can see. My web search shows that to upgrade, I have to rebuild python from scratch. Is this the only way?? More on forums.rockylinux.org
🌐 forums.rockylinux.org
0
0
January 3, 2022
Why Can't I Install the Random Module?
random is part of the python standard libraries ( https://docs.python.org/3/library/ ). Have you tried importing it? Does it throw an error? More on reddit.com
🌐 r/Python
12
0
February 5, 2017
People also ask

Where can I download Python 3.8 for Ubuntu?
Install Python 3.8 through the Deadsnakes PPA on Ubuntu 24.04 or 22.04 with apt, which handles the download and installation automatically. For source builds, download the Python 3.8.20 tarball from python.org/ftp/python/3.8.20/ and compile it on any Ubuntu LTS release. There is no standalone binary download for Ubuntu.
🌐
linuxcapable.com
linuxcapable.com › home › ubuntu › how to install python 3.8 on ubuntu (26.04, 24.04, 22.04)
How to Install Python 3.8 on Ubuntu (26.04, 24.04, 22.04) - ...
Does Ubuntu 20.04 include Python 3.8 by default?
Yes. Ubuntu 20.04 shipped Python 3.8 as the default system interpreter. However, Ubuntu 20.04 reached end of standard support in April 2025 and no longer receives security updates. Upgrade to Ubuntu 22.04 or 24.04 and use the Deadsnakes PPA to install Python 3.8 on a supported base system.
🌐
linuxcapable.com
linuxcapable.com › home › ubuntu › how to install python 3.8 on ubuntu (26.04, 24.04, 22.04)
How to Install Python 3.8 on Ubuntu (26.04, 24.04, 22.04) - ...
Can I install a specific Python 3.8.10 version instead of 3.8.20 on Ubuntu?
The Deadsnakes PPA only provides the latest Python 3.8 build (currently 3.8.20), so you cannot pin to an older point release like 3.8.10 through APT. If you need exactly 3.8.10, download its source from python.org/ftp/python/3.8.10/ and compile from source, but 3.8.20 includes all 3.8.10 fixes plus OpenSSL 3 compatibility, so there is rarely a reason to use the older build.
🌐
linuxcapable.com
linuxcapable.com › home › ubuntu › how to install python 3.8 on ubuntu (26.04, 24.04, 22.04)
How to Install Python 3.8 on Ubuntu (26.04, 24.04, 22.04) - ...
🌐
LinuxCapable
linuxcapable.com › home › ubuntu › how to install python 3.8 on ubuntu (26.04, 24.04, 22.04)
How to Install Python 3.8 on Ubuntu (26.04, 24.04, 22.04) - LinuxCapable
1 month ago - When updates are available, upgrade ... packages in the command based on what you installed. ... Visit the official Python download page and copy the download link for the latest Python 3.8.x release....
🌐
Reddit
reddit.com › r/linuxmint › how to install python 3.8 on linuxmint
r/linuxmint on Reddit: How to Install Python 3.8 on LinuxMint
October 16, 2019 -

At the writing time of this article Python latest stable version 3.8 series is available to install. This article will help you to install Python 3.8 on LinuxMint operating system. You can visit here to read more about Python releases.

Step 1 – Prerequisites

Use the following command to install prerequisites for Python before installing it.

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

Step 2 – Download Python 3.8

Download Python from the python official site.

Step 3 – Install Python 3.8

After download extract the .tar.xz file. Then inside the Python-3.8.0 folder open terminal. Use below set of commands to install Python 3.8

./configure
make
make test
sudo make install

All Done! This will install Python as ``python3``. Open the terminal and see yourself!

Find elsewhere
🌐
Medium
eazytechy.medium.com › how-to-install-python-3-8-on-ubuntu-22-04-e4ad4d37ad93
How to Install Python 3.8 on Ubuntu 22.04 | by Sumit Jain | Medium
January 29, 2023 - In the following tutorial, you will learn how to install Python 3.8 using the command terminal and how to download and compile as an alternative method.
🌐
TecAdmin
tecadmin.net › install-python-3-8-ubuntu
How to Install Python 3.8 on Ubuntu, Debian and LinuxMint – TecAdmin
April 26, 2025 - The Python team has released its latest version Python 3.8 for general use. You can download the latest stable version Python 3.8 series and install it on your system. This article will help you to install Python 3.8.12 on Ubuntu, Debian, and LinuxMint operating systems.
Top answer
1 of 3
29

This post is community wiki so as to not claim the credit of @Kulfy's comment. This procedure worked on Ubuntu 18.04.

DON'T EVER CHANGE DEFAULT PYTHON!!! It may cause your system to break and some applications won't even run. It's far far far better to invoke python3.8 using python3.8 command

When installing python3.8, do the following

$ sudo apt-get install python3.8 python3.8-dev python3.8-distutils python3.8-venv

For most people this will be acceptable as they will be using a virtual environment for development. Construct a virtual environment and activate it as you usually would. This will leave you in a terminal where python resolves to python3.8:

$ python3.8 -m venv dev3.8/
$ source dev3.8/bin/activate
(dev3.8) $ which python
...dev3.8/bin/python
(dev3.8) $ python --version
Python 3.8.0

Neglecting to install python3.8-venv will result in an unhelpful error, that suggests you should install python-venv which resolves to python3.6-venv:

$ python3.8 -m venv dev3.8/
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ... (trimmed for formatting)
2 of 3
9

Step 1: Install the latest version of python. Currently, 3.8 is the latest

sudo apt install python3.8

Step 2: Add Python 3.6 & Python 3.8 to update-alternatives

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6.9
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8.1

Step 3: Update Python 3 to point to Python 3.7

By default, Python 3.6 is pointed to Python 3. So, we run python3 it will execute as python3.6 but we want to execute this as python3.8

sudo update-alternatives --config python3

You should get a similar output. Now type 2 and hit enter for Python 3.

Step 4: Test the version of python

Finally test the current version of python by typing

python3 -V
🌐
Oracle
docs.oracle.com › en › industries › financial-services › banking-apis › 22.2.4.0.0 › obinp › python-3.8.0-installation-linux-operating-system.html
1.3 Python 3.8.0 installation on Linux Operating System
June 11, 2024 - dnf groupinstall 'development tools' dnf install bzip2-devel expat-devel gdbm-devel ncurses-devel openssl-devel readline-devel wget sqlite-devel tk-devel xz-devel zlib-devel libffi-devel wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz tar -xzvf Python-3.8.0.tgz cd Python-3.8.0.
🌐
Linuxize
linuxize.com › home › python › how to install python 3.8 on ubuntu 18.04
How to Install Python 3.8 on Ubuntu 18.04 | Linuxize
November 5, 2019 - In this section, we’ll explain how to compile Python 3.8 from the source. Update the packages list and install the packages necessary to build Python: ... sudo apt update sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev · Download the latest release’s source code from the Python download page using wget :
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
How to install Python 3.8 - Rocky Linux Help & Support - Rocky Linux Forum
January 3, 2022 - I tried to install gensim using pip3 install -U gensim but it died with the message that python 3.8 is required. However, Rocky ships with only 3.6 as far as I can see. My web search shows that to upgrade, I have to r…
🌐
Real Python
realpython.com › installing-python
How to Install Python on Your System: A Guide – Real Python
February 18, 2026 - Learn how to install the latest Python version on Windows, macOS, and Linux. Check your version and choose the best installation method for your system.
🌐
Cloudera
docs.cloudera.com › cdp-private-cloud-base › 7.1.9 › installation › topics › cdpdc-cm-install-python-3-rhel8-standard-location.html
Installing Python 3.8 standard package on RHEL 8
July 19, 2024 - If you are using RHEL 8, Cloudera recommends that you uninstall Python 2.7, if it is present on your hosts. If you are using RHEL 7, do not uninstall Python 2.7. SSH into the host system as a root user. Install Python 3.8 by running the following command:
🌐
Python
python.org › downloads › release › python-3817
Python Release Python 3.8.17 | Python.org
Note: The release you're looking at is Python 3.8.17, a security bugfix release for the legacy 3.8 series. Python 3.11 is now the latest feature release series of Python 3.
🌐
DEV Community
dev.to › mortoray › how-to-install-python-3-8-on-ubuntu-1bp4
How to install Python 3.8 on Ubuntu? - DEV Community
June 16, 2019 - I have that installed, and that pip doesn't work correctly with python3.8. I needed the python3.8-venv to create a virtual environment, and then I could use pip within it. ... I encountered the same problem. Finally I use pyenv to install Python 3.8 on Ubuntu 18.04.
🌐
Python
python.org › downloads › release › python-380
Python Release Python 3.8.0 | Python.org
Warning: Python 3.8.0 reached end-of-life on 2024-10-07. It is no longer supported and does not receive security updates.
🌐
Python
python.org › downloads › release › python-3818
Python Release Python 3.8.18 | Python.org
Note: The release you're looking at is Python 3.8.18, a security bugfix release for the legacy 3.8 series. Python 3.11 is now the latest feature release series of Python 3.
🌐
Python
python.org › downloads › release › python-3813
Python Release Python 3.8.13 | Python.org
According to the release calendar specified in PEP 569, Python 3.8 is now in the "security fixes only" stage of its life cycle: 3.8 branch only accepts security fixes and releases of those are made irregularly in source-only form until October 2024. Python 3.8 isn't receiving regular bug fixes anymore, and binary installers are no longer provided for it.
🌐
Python
python.org › downloads › release › python-3812
Python Release Python 3.8.12 | Python.org
According to the release calendar specified in PEP 569, Python 3.8 is now in the "security fixes only" stage of its life cycle: 3.8 branch only accepts security fixes and releases of those are made irregularly in source-only form until October 2024. Python 3.8 isn't receiving regular bug fixes anymore, and binary installers are no longer provided for it.