Python Forum
ModuleNotFoundError: No module named "requests"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named "requests"
#1
I have a very simple script that saves me a lot of time scraping a few URLs on occasion. I ran the code just fine 2 weeks ago, and now when I go to run it, I get the error

Traceback (most recent call last):
  File "addevents.py", line 11, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
so, just for fun I ran

pip3.7 install requests
and I get the output

Requirement already satisfied: requests in /usr/local/lib/python3.7/site-packages (2.22.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests) (1.25.7)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/site-packages (from requests) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests) (2019.9.11)
and sure enough when I run

help("modules")
I don't see "requests" anywhere. No clue what to do here. And I'm about to go insane. Please send help.

Python version 3.7.3
pip version 19.3.1
macOS 10.15.2
Reply
#2
First ideas what come to mind: do you use virtual environments and are you actually defaulting to using Python 3.7 (and not some other version).
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  POST requests - different requests return the same response Default_001 3 1,901 Mar-10-2022, 11:26 PM
Last Post: Default_001
  No module named theapp Clives 10 5,677 Jun-10-2021, 11:16 AM
Last Post: Larz60+
  Requests module get() incomplete download bobzarm 2 2,486 Feb-17-2021, 04:51 PM
Last Post: bobzarm
  requests module is not working varsh 3 3,750 Sep-10-2020, 03:53 PM
Last Post: buran
  Django getting ModuleNotFoundError: No module named '=' Malt 0 2,928 Aug-30-2019, 08:34 AM
Last Post: Malt
  No module named flask_themes voipsense 4 4,776 Feb-25-2019, 06:54 PM
Last Post: voipsense
  About .profile and ImportError: No module named RicardoAbdala 1 3,097 Aug-28-2018, 05:32 AM
Last Post: buran
  ImportError: No module named django.core.exceptions in google app engine timtinan37 4 4,911 Jun-18-2018, 01:34 PM
Last Post: Larz60+
  An Error in Requests Module pratheep 3 11,871 Feb-06-2018, 05:17 PM
Last Post: pratheep
  Using python requests module and BS4 to login on an Wordpress based website apollo 1 9,371 Feb-06-2018, 01:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020