Libraries | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Libraries

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!

2nd May 2022, 1:30 PM
Knowledge Is Power
Knowledge Is Power - avatar
6 Answers
+ 7
Could be line 3🤔🤔🤔 No... fun Please send first 100 lines of your code
2nd May 2022, 1:38 PM
Oma Falk
Oma Falk - avatar
+ 5
Requests 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
2nd May 2022, 1:45 PM
Tibor Santa
Tibor Santa - avatar
+ 3
Most likely you did not install the library. Use pip or pip3 to install it. Something like: pip install requests
2nd May 2022, 1:43 PM
Maz
Maz - avatar
+ 3
Add this line in 1st line on your code: import os os.system('pip install-qq requests')
2nd May 2022, 11:52 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
0
Thank you for your support👍
3rd May 2022, 7:38 PM
Knowledge Is Power
Knowledge Is Power - avatar
0
pip install requests
3rd May 2022, 8:41 PM
underscore
underscore - avatar