How To Install python39 on CentOS 8

python39 is Version 3.9 of the Python interpreter

Introduction

In this tutorial we learn how to install python39 on CentOS 8.

What is python39

Python 3.9 is an accessible, high-level, dynamically typed, interpreted programming language, designed with an emphasis on code readability. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. The python39 package provides the “python3.9” executable interpreter for the Python language, version 3. The majority of its standard library is provided in the python39-libs package, which should be installed automatically along with python39. The remaining parts of the Python standard library are broken out into the python39-tkinter and python39-test packages, which may need to be installed separately. Documentation for Python is provided in the python39-docs package. Packages containing additional libraries for Python are generally named with the “python39-” prefix. For the unversioned “python” executable, see manual page “unversioned-python”.

We can use yum or dnf to install python39 on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install python39.

Install python39 on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python39 using dnf by running the following command:

sudo dnf -y install python39

Install python39 on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python39 using yum by running the following command:

sudo yum -y install python39

How To Uninstall python39 on CentOS 8

To uninstall only the python39 package we can use the following command:

sudo dnf remove python39

python39 Package Contents on CentOS 8

/usr/bin/pydoc-3
/usr/bin/pydoc3
/usr/bin/pydoc3.9
/usr/bin/python3
/usr/bin/python3.9
/usr/bin/unversioned-python
/usr/lib/.build-id
/usr/lib/.build-id/0b
/usr/lib/.build-id/0b/a4590c6f56cbe0efce22e0d4224a0f527489f9
/usr/share/doc/python39
/usr/share/doc/python39/README.rst
/usr/share/man/man1/python.1.gz
/usr/share/man/man1/python3.1.gz
/usr/share/man/man1/python3.9.1.gz

References

Summary

In this tutorial we learn how to install python39 on CentOS 8 using yum and dnf.