How To Install python2-requests on Rocky Linux 8

In this tutorial we learn how to install python2-requests on Rocky Linux 8. python2-requests is HTTP library, written in Python, for human beings

Introduction

In this tutorial we learn how to install python2-requests on Rocky Linux 8.

What is python2-requests

Most existing Python modules for sending HTTP requests are extremely verbose and cumbersome. Python’s built-in urllib2 module provides most of the HTTP capabilities you should need, but the API is thoroughly broken. This library is designed to make HTTP requests easy for developers.

We can use yum or dnf to install python2-requests on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install python2-requests.

Install python2-requests on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install python2-requests using dnf by running the following command:

sudo dnf -y install python2-requests

Install python2-requests on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install python2-requests using yum by running the following command:

sudo yum -y install python2-requests

How To Uninstall python2-requests on Rocky Linux 8

To uninstall only the python2-requests package we can use the following command:

sudo dnf remove python2-requests

python2-requests Package Contents on Rocky Linux 8

/usr/lib/python2.7/site-packages/requests
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/PKG-INFO
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/SOURCES.txt
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/dependency_links.txt
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/not-zip-safe
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/requires.txt
/usr/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg-info/top_level.txt
/usr/lib/python2.7/site-packages/requests/__init__.py
/usr/lib/python2.7/site-packages/requests/__init__.pyc
/usr/lib/python2.7/site-packages/requests/__init__.pyo
/usr/lib/python2.7/site-packages/requests/__version__.py
/usr/lib/python2.7/site-packages/requests/__version__.pyc
/usr/lib/python2.7/site-packages/requests/__version__.pyo
/usr/lib/python2.7/site-packages/requests/_internal_utils.py
/usr/lib/python2.7/site-packages/requests/_internal_utils.pyc
/usr/lib/python2.7/site-packages/requests/_internal_utils.pyo
/usr/lib/python2.7/site-packages/requests/adapters.py
/usr/lib/python2.7/site-packages/requests/adapters.pyc
/usr/lib/python2.7/site-packages/requests/adapters.pyo
/usr/lib/python2.7/site-packages/requests/api.py
/usr/lib/python2.7/site-packages/requests/api.pyc
/usr/lib/python2.7/site-packages/requests/api.pyo
/usr/lib/python2.7/site-packages/requests/auth.py
/usr/lib/python2.7/site-packages/requests/auth.pyc
/usr/lib/python2.7/site-packages/requests/auth.pyo
/usr/lib/python2.7/site-packages/requests/certs.py
/usr/lib/python2.7/site-packages/requests/certs.pyc
/usr/lib/python2.7/site-packages/requests/certs.pyo
/usr/lib/python2.7/site-packages/requests/compat.py
/usr/lib/python2.7/site-packages/requests/compat.pyc
/usr/lib/python2.7/site-packages/requests/compat.pyo
/usr/lib/python2.7/site-packages/requests/cookies.py
/usr/lib/python2.7/site-packages/requests/cookies.pyc
/usr/lib/python2.7/site-packages/requests/cookies.pyo
/usr/lib/python2.7/site-packages/requests/exceptions.py
/usr/lib/python2.7/site-packages/requests/exceptions.pyc
/usr/lib/python2.7/site-packages/requests/exceptions.pyo
/usr/lib/python2.7/site-packages/requests/help.py
/usr/lib/python2.7/site-packages/requests/help.pyc
/usr/lib/python2.7/site-packages/requests/help.pyo
/usr/lib/python2.7/site-packages/requests/hooks.py
/usr/lib/python2.7/site-packages/requests/hooks.pyc
/usr/lib/python2.7/site-packages/requests/hooks.pyo
/usr/lib/python2.7/site-packages/requests/models.py
/usr/lib/python2.7/site-packages/requests/models.pyc
/usr/lib/python2.7/site-packages/requests/models.pyo
/usr/lib/python2.7/site-packages/requests/packages.py
/usr/lib/python2.7/site-packages/requests/packages.pyc
/usr/lib/python2.7/site-packages/requests/packages.pyo
/usr/lib/python2.7/site-packages/requests/sessions.py
/usr/lib/python2.7/site-packages/requests/sessions.pyc
/usr/lib/python2.7/site-packages/requests/sessions.pyo
/usr/lib/python2.7/site-packages/requests/status_codes.py
/usr/lib/python2.7/site-packages/requests/status_codes.pyc
/usr/lib/python2.7/site-packages/requests/status_codes.pyo
/usr/lib/python2.7/site-packages/requests/structures.py
/usr/lib/python2.7/site-packages/requests/structures.pyc
/usr/lib/python2.7/site-packages/requests/structures.pyo
/usr/lib/python2.7/site-packages/requests/utils.py
/usr/lib/python2.7/site-packages/requests/utils.pyc
/usr/lib/python2.7/site-packages/requests/utils.pyo
/usr/share/doc/python2-requests
/usr/share/doc/python2-requests/HISTORY.md
/usr/share/doc/python2-requests/README.md
/usr/share/licenses/python2-requests
/usr/share/licenses/python2-requests/LICENSE

References

Summary

In this tutorial we learn how to install python2-requests on Rocky Linux 8 using yum and dnf.