Python is an extremely popular, versatile, and easy-to-learn programming language that is widely used in various industries and applications, from web development and data analysis to artificial intelligence and machine learning. Python 3.9 is one of the latest versions of the language, offering improved performance and a host of new features.
In this tutorial, we will guide you through the process of installing Python 3.9 on CentOS/RHEL 7 and Fedora operating systems using the source archive file. This method of installation ensures that you have full control over the installation process and can customize it to suit your specific needs.
This Python installation required the GCC compiler on your system. Login to your server using ssh or shell access. Now, use the following command to install prerequisites for Python before installing it.
sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
Step 1 – Download Python 3.9
Download Python using following command from python official site. You can also download the latest version in place of the specified below.
Then, extract the archive file on your system:
tar xzf Python-3.9.16.tgz
This will create a directory named Python-3.9.16 in the current directory.
Step 2 – Install Python 3.9 on CentOS
Change directory to Python-3.9.16 and use the following commands to compile Python source code on your system using
sudo ./configure --enable-optimizations
sudo make altinstall
Now remove downloaded source archive file from your system
sudo rm Python-3.9.16.tgz
Step 3 – Test Python Version
Check the latest version installed of python using the below command
python3.9 -VPython 3.9.16
In this tutorial, we demonstrated the step-by-step process of installing Python 3.9 on CentOS/RHEL 7 and Fedora systems using the source archive file. This method provides a more customizable installation experience and ensures that you have the latest Python version on your system. By following these steps, you can now enjoy the benefits of Python 3.9’s improved performance and new features, which will help you develop and deploy your projects more efficiently. As you continue to explore Python, consider familiarizing yourself with its vast ecosystem of libraries and frameworks to further enhance your programming capabilities.