Advance

Tutorial Install Python 3 on RHEL 8 / CentOS 8

Install Python 3 on RHEL 8 - CentOS 8
1
(1)

Install Python 3 on RHEL 8 / CentOS 8, Python is widely used at various levels of server management or management of DevOPS structures. So familiar with the language will be useful to you. In this article, we want to teach you how to install Python on RHEL 8 / CentOS 8.

Installing Python on these operating systems will not be difficult. You can use package manager to install Python version 3.

Recommended Article: How to install VNC on CentOS Linux

 

How to install Python 3 on RHEL 8 / CentOS 8

Step 1 – Install Python 3

To install Python on RHEL 8 and CentOS 8, use the following command:

$ sudo dnf install python3  

After installing python, you can use the command which you can see the executable file of Python:

$ which python3  /usr/bin/python3

You can use Python using the python 3 command. But it is not possible to use the python command alone, which we will solve in the next step.

Step 2 – Set the default version of python

The following message will appear when you use the python command in your Linux:

$ python  bash: python: command not found...

To fix the problem, you can use the alternatives command to fix the problem. To solve the problem for python 3, use the following command:

$ sudo alternatives --set python /usr/bin/python3

After executing the above command, you can check the execution of the python command on your server:

$ python -V  Python 3.0.06

Or if you use the python command, you can see other information about Python:

$ python  Python 3.0.06 (default, Oct 16 2019, 15:28:01)   [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux2  Type "help", "copyright", "credits" or "license" for more information.  >>>

You can also use the following command to reset python settings to default:

$ sudo alternatives --auto python

Good luck.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day