I am getting ImportError : no module named 'requests'
.
But I have installed the requests
package using the command pip install requests
.
On running the command pip freeze
in the command prompt, the result is
requests==2.7.0
So why is this sort of error happening while running the python file?
Requests are not a built-in module (it doesn't come with the default python installation) in Python, you need to install it explicitly using the pip installer and then use it. If you are getting an error installing pip checkout pip: command not found to resolve the issue.
Requests is one of the most popular Python libraries that is not included with Python.
Run in command prompt.
pip list
Check what version you have installed on your system if you have an old version.
Try to uninstall the package...
pip uninstall requests
Try after to install it:
pip install requests
You can also test if pip does not do the job.
easy_install requests
I had this error before when I was executing a python3 script, after this:
sudo pip3 install requests
the problem solved, If you are using python3, give a shot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With