Install Python 3.8 on CentOS 8

python Is one of the most widely used Programming language in the world. With its easy-to-learn syntax, Python is a popular choice for beginners and experienced developers. Python is a general-purpose programming language. It can be used to build a variety of applications, from simple handwriting to complex machine learning algorithms. As of this writing Python 3.8 latest stable version Can be downloaded and installed. This article will help you Install Python 3.8.1 on CentOS, Red Hat and Fedora operating systems.This guide explains how to build Python 3.8 on CentOS 8 from source code.

Install Python 3.8 on CentOS 8

The first thing to do is to install the necessary packages Build Python from source on CentOS 8. To do this, run the following command as the root or sudo user:

# sudo dnf -y groupinstall 'development tools'
# sudo dnf -y install openssl-devel bzip2-devel libffi-devel

Download python from the python official site using the following command. You can also download the latest version instead of the version specified below.

# cd /opt
# cd /opt
# wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz

Unzip the downloaded package now.

# tar xzf Python-3.8.1.tgz

Move to the Python directory.

# cd Python-3.8.1

Let’s start the installation setup by running the configuration script

# sudo ./configure --enable-optimizations
# sudo make altinstall

make altinstall is used to prevent replacing the default python binary / usr / bin / python. After successful installation, you will see similar output:

.........
rm -r /usr/local/lib/python3.8/lib-dynload/__pycache__
/bin/install -c -m 644 ./Misc/python.man 
        /usr/local/share/man/man1/python3.8.1
if test "xupgrade" != "xno"  ; then 
        case upgrade in 
                upgrade) ensurepip="--altinstall --upgrade" ;; 
                install|*) ensurepip="--altinstall" ;; 
        esac; 
         ./python -E -m ensurepip 
                $ensurepip --root=/ ; 
fi
Looking in links: /tmp/tmp8ii0zwgu
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.2.3 setuptools-41.2.0

Confirm installation Python 3.8 on CentOS 8

# python3.8 --version

The output should show the Python version:

Python 3.8.1

Points are also installed.

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

in conclusion

We show you how Install Python 3.8 on CentOS 8 machine. If you have any questions or feedback, please leave a comment below.

Sidebar