• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Python 3.9 on CentOS 8

Written by Admin, Updated On December 20, 2020
centos, python
How to Install Python 3.9 on CentOS 8

Python is most popular programming language. It’s used to write small scripts, build games, develop websites, create machine learning algorithms, analyze data and more. In this tutorial, we will show you how to install python 3.9 on CentOS 8 system.

Install Python 3.9 on CentOS 8#

By default, Python 3.6 is included on CentOS 8. Currently, at the time of writing this article, Python 3.9 is the latest major release of Python. includes many new features such as new dict operators, new str functions, support for IANA time zone, and more. Python 3.9 is not available in the standard CentOS 8 repositories. On CentOS, you can install packages either with dnf or yum command.

Step 1: Install Python Dependencies#

First, we need to install necessary packages to build Python from the source code on CentOS 8. Run the following commands as root or user with sudo privileges.

sudo dnf install wget yum-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel

Step 2: Download Python 3.9#

Download the latest release source code from the Python download page using wget command. Currently, the latest Python 3.9 release is 3.9.1.

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

Extract the package using below command:

tar xvf Python-3.9.1.tgz

Navigate to the python source directory.

cd Python-3.9.1

Step 3: Install Python 3.9#

Run the configuration script to check all of the dependencies on your system are available:

sudo ./configure --enable-optimizations

Initiate compilation of Python 3.9 on CentOS 8.

sudo make altinstall

Note : Do not use the standard make install otherwise it will overwrite the default system python binary.

That’s it. Python 3.9 has been installed on your CentOS system, and you can start using it.

Now, we don’t need

Step 4 – Verify Installation#

Verify the installation by checking version:

python3.9 --version

The output should show the Python version:

Python 3.9.1

Pip is also installed, you can check version by typing:

pip3.9 -V
pip 20.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

Conclusion#

I hope you successfully learned how to install Python 3.9 on your CentOS 8 system.

If you have any questions or feedback, please leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install GIMP 2.10 on CentOS 8
Next Article   How to Install PHP 8 on Debian 10

Related Posts

  • How to Install Php 8 on CentOS 8

    How to Install PHP 8 on CentOS 8

    January 27, 2021
  • How to Install GIMP 2.10 on CentOS 8

    How to Install GIMP 2.10 on CentOS 8

    December 30, 2020
  • How to Install Notepad++ on CentOS 8

    How to Install Notepad++ on CentOS 8

    December 26, 2020

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook