-2

Is anyone else receiving a moduleNotFoundError with their requests library? Not sure why this is happening. The library is installed as well which is even more confusing.


import csv
from datetime import datetime
import requests
from bs4 import BeautifulSoup

and the resulting error was this:




---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [1], line 4
      2 import csv
      3 from datetime import datetime
----> 4 import requests
      5 from bs4 import BeautifulSoup

ModuleNotFoundError: No module named 'requests'



when i run pip freeze I can confirm I have requests installed as well, see below:

Screenshot from my terminal

I have requests version requests==2.28.1

2 Answers2

0

Most likely, you don't have the requests module installed. Run the following command: pip install requests to install the package.

Craze XD
  • 110
  • 8
0

corrected the error by referencing this question (i didnt see it when I first searched)

running sudo pip3 install requests and it recognized the library now.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 30 '22 at 00:57