Install Python 3.8 Rhel 8

0 views
Skip to first unread message

Saija Grzegorek

unread,
Jun 18, 2024, 11:56:36 AM6/18/24
to huffresetu
# How to Install Python 3.8 on RHEL 8
Python is one of the most popular and versatile programming languages in the world. It is used for various purposes, such as web development, data analysis, machine learning, automation, and more. Python 3.8 is the latest stable version of Python, which offers many new features and improvements over the previous versions.
However, if you are using RHEL 8 (Red Hat Enterprise Linux 8), you might not have Python 3.8 installed by default. RHEL 8 comes with Python 3.6 as the default Python version, which might not be compatible with some of the latest Python libraries and frameworks. Therefore, you might want to install Python 3.8 on your RHEL 8 system to take advantage of the latest Python features and functionalities.
In this article, we will show you how to install Python 3.8 on RHEL 8 using two methods: using the Software Collections (SCL) repository or using the source code. Both methods are easy and straightforward, but they have some pros and cons that you should consider before choosing one.
## Method 1: Using the Software Collections (SCL) Repository
The Software Collections (SCL) repository is a curated collection of software packages that provide newer versions of software than the ones available in the default RHEL repositories. The SCL repository contains Python 3.8 as well as other software packages that you might need for your development or production environment.
The advantage of using the SCL repository is that it is maintained and supported by Red Hat, which means that you can get security updates and bug fixes for the software packages that you install from it. The disadvantage is that you have to enable the SCL repository on your system and use a special command to run the software packages that you install from it.
To install Python 3.8 from the SCL repository, follow these steps:
- Enable the SCL repository on your system by running the following command as root or with sudo:
```bash
```
- Install Python 3.8 from the SCL repository by running the following command as root or with sudo:
```bash
yum install rh-python38
```
- To run Python 3.8, you have to use the `scl` command to enable the software collection that contains it. For example, to run an interactive Python 3.8 shell, run the following command:
```bash
scl enable rh-python38 python
```
- To make Python 3.8 the default Python version on your system, you can create an alias for it in your `.bashrc` file. For example, add the following line to your `.bashrc` file:
```bash
alias python='scl enable rh-python38 python'
```
- To verify that Python 3.8 is installed correctly on your system, run the following command:
```bash
python --version
```
You should see something like this:
```bash
Python 3.8.0
```
## Method 2: Using the Source Code
Another way to install Python 3.8 on RHEL 8 is to compile it from the source code. The source code is the original code that was written by the developers of Python, which you can download and build on your system. The advantage of using the source code is that you can customize and optimize it according to your needs and preferences. The disadvantage is that you have to install some dependencies and tools to compile it, and you have to manually update it whenever there is a new version available.
To install Python 3.8 from the source code, follow these steps:
- Install some dependencies and tools that are required to compile Python from source by running the following command as root or with sudo:
```bash
yum groupinstall "Development Tools"
yum install openssl-devel bzip2-devel libffi-devel
```
- Download the latest source code of Python 3.8 from the official website by running the following command:
```bash
```
- Extract the downloaded file by running the following command:
```bash
tar xvf Python-3.8.12.tgz

install python 3.8 rhel 8


Download https://t.co/PFNo6MvxDu



e8e8a447ac
Reply all
Reply to author
Forward
0 new messages