I am working on API calls using requests dictionary. But I am getting an error message that import requests Exception has occurred:Module not found error. How do I fix it? I am using visual studio code. Please help!
5/2/2022 1:30:51 PM
Knowledge Is Power6 Answers
New AnswerRequests is an external library, not part of core python. If it is not installed on the python environment where you try to run it, then first you need to install like this (or some variance of it, based on your operating system) python -m pip install requests See also https://docs.python-requests.org
Add this line in 1st line on your code: import os os.system('pip install-qq requests')
Most likely you did not install the library. Use pip or pip3 to install it. Something like: pip install requests
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message