Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Python 3.9 on CentOS 8 - DesignLinux

Dec 30 2020
designlinux 0 Comments
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.

Related

Tags: centos, python

How to Disable Suspend and Hibernation Modes In Linux

Prev Post

How to Convert PDF to Image in Linux Command Line

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 259
  • 614,631

DesignLinux.com © All rights reserved

Go to mobile version