In this guide, you’ll learn how to install Python 3.8 on CentOS 7 / CentOS 8. Python is a popular programming language originally created by Guido van Rossum, and released in 1991. Python can be used to create web applications, handle big data and perform complex mathematics, system scripting, rapid prototyping and many other types of software Development.

For Python 2.7 and Python 3 installation on CentOS 8, check our guide – Install and Switch version of Python on CentOS 8

Recommended Python books: Best Books for Learning Python Programming

Install Python 3.8 on CentOS 7 / CentOS 8

Python works on Windows, Mac, Linux, Raspberry Pi, BSD and many other systems. As of this article update, the latest release of Python is version Python 3.8.3. This is the version of Python that we’ll install in this guide.

Step 1: Install Python Dependencies

As we’ll install Python from source, let’s install the packages required for Python installation.

sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install openssl-devel bzip2-devel libffi-devel

Confirm gcc is available:

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Step 2: Download latest Python 3.8 Archive

Now download the latest archive of Python 3.8 release.

sudo yum -y install wget

Extract the package.

tar xvf Python-3.8.3.tgz

Change the created directory:

cd Python-3.8*/

Step 2: Install Python 3.8 on CentOS 7 / CentOS 8

Setup installation by running the configure script.

./configure --enable-optimizations

Initiate compilation of Python 3.8 on CentOS 7.

sudo make altinstall

If this was successful, you should get a message like below:

copying build/scripts-3.8/pydoc3.8 -> /usr/local/bin
copying build/scripts-3.8/idle3.8 -> /usr/local/bin
copying build/scripts-3.8/2to3-3.8 -> /usr/local/bin
changing mode of /usr/local/bin/pydoc3.8 to 755
changing mode of /usr/local/bin/idle3.8 to 755
changing mode of /usr/local/bin/2to3-3.8 to 755
rm /usr/local/lib/python3.8/lib-dynload/
rm -r /usr/local/lib/python3.8/lib-dynload/__pycache__
/usr/bin/install -c -m 644 ./Misc/ \
if test "xupgrade" != "xno"  ; then \
	case upgrade in \
		upgrade) ensurepip="--altinstall --upgrade" ;; \
		install|*) ensurepip="--altinstall" ;; \
	esac; \
	 ./python -E -m ensurepip \
		$ensurepip --root=/ ; \
Looking in links: /tmp/tmpy9yqf1bp
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.2.3 setuptools-41.2.0

Check Python 3.8 on CentOS 8 / CentOS 7.

Confirm that the installation of Python 3.8 on CentOS 8 / CentOS 7 was successful.

$ python3.8 --version
Python 3.8.3

Pip is also installed.

$ pip3.8 --version
pip 19.2.3 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

Recommended Python books: Best Books for Learning Python Programming

More on Python:

Deploy Python 3 Django Application on CentOS 7 with Apache and mod_wsgi

How To Install Python & Django on Debian

Best Books for Learning Python Programming

Install Python 3 / Python 2.7 on CentOS 8 / RHEL 8

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.



Please enter your comment!
Please enter your name here