modulenotfounderror no module named requests
modulenotfounderror no module named requests
I got the error ‘ModuleNotFoundError No module named requests’ while trying to import the module in python3. Follow the below steps to fix the error.
1. Log into your Linux server via SSH
2. requests can be installed using pip
3. Run the command ‘pip3 install requests’
4. Import requests to confirm it is installed correctly

ModuleNotFoundError No module named requests
STEPS:
First check the version of Python installed on your server.
Python 3.6.8
The below command checks whether python-pip package is installed or not :
python3-pip-9.0.3-20.el8.noarch
OR
pip 21.3.1
Run the command ‘yum install python-pip’ OR ‘yum install python3-pip’ to install python-pip package on your CentOS server.
pip is the package installer for Python. To install requests using pip:
Import requests to make sure it is installed correctly.
Python 3.6.8 (default, Nov 21 2019, 19:31:34)
[GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import requests
OR you can run ‘pip3 freeze | grep -i requests’ to confirm
requests==2.26.0
Follow the below steps if you want to install a specific version of requests
Example :
#pip3 install requests==2.25.1
The above command will install requests version 2.25.1.