How To Fix ModuleNotFoundError: no module named ‘requests’ In Python

ModuleNotFoundError: No module named ‘requests’

When using Python, ModuleNotFoundError: no module named ‘requests’ is an error many people may encounter. This article will present the procedure to fix this error for your operating system.

ModuleNotFoundError: no module named ‘requests’

The ‘request’ module is an HTTP library for Python. ‘request’ module allow users to send HTTP/1.1 requests easily. Then you won’t need to put query and query strings in your URLs manually. The ‘request’ module are not automatically installed on Python. So the error ModuleNotFoundError: No module named ‘requests’ appears when you don’t have ‘request’ module installed, or it was placed in the incorrect environment before import.


import request


Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import request
ModuleNotFoundError: No module named 'request'

To fix the ModuleNotFoundError: No module named ‘requests’ error, all you need to do is install ‘request’ module.

The ways to install requests


First, you must have Python and pip installed on your computer, preferably the latest version of Python and pip.

To install ‘request’ module using pip, open a command prompt and run the following command:

pip3 install requests

The ‘request’ library is downloaded successfully.


Python is installed by default on most Linux distributions. But you need to install pip. Pip can be installed from the terminal. However, the method of installing pip has different syntaxes between Linux distributions. To install pip, you need to have root privileges, then open a terminal and use the commands with the correct syntax for the Linux distribution you are using.

Following is the pip installation syntax of some popular Linux distributions:

  •  Debian, Linux Mint, and Ubuntu
sudo apt install python-pip3
  •  Fedora, CentOS 8 (and newer) and Red Hat
sudo dnf install python-pip3
  • Older versions of Red Hat and CentOS 6 and 7
sudo yum install epel-release
sudo yum install python-pip3
  • Manjaro and Arch Linux
sudo pacman -S python-pip
  • OpenSUSE
sudo zypper python3-pip

Now, you can install ‘request’ module by run this code:

pip3 install requests


The following curl command will make it possible to download pip:

curl -o

This curl command allows you to download pip using a specified direct link. In this curl command, the -o option is used to name the download file.

Install pip by running:


Install ‘request’ from the terminal:

pip3 install requests

Alternative common method

The last method for installing ‘request’ on any operating system is to grab the base files and install ‘request’ manually. The ‘request’ module are actively developed on GitHub, where the code is always available. For code, visit here.

You can clone the public repository:

git clone git://

Or, download the tarball:

curl -OL

Once you have a copy of the source, you can embed it in your Python package or install it into your site-packages easily:

cd requests
pip install


This article has shown the cause and how to fix the ModuleNotFoundError: No module named ‘requests’ error in Python. I hope the information in this article was helpful to you.

Maybe you are interested in similar errors:

Leave a Reply

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