Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for 'requests' Package #27

Open
sophiestrazie opened this issue Jul 1, 2023 · 0 comments
Open

Workaround for 'requests' Package #27

sophiestrazie opened this issue Jul 1, 2023 · 0 comments

Comments

@sophiestrazie
Copy link

sophiestrazie commented Jul 1, 2023

Error Message:
AttributeError: module 'requests' has no attribute 'get'

Issue
Is there a workaround? I tried importing requests and gd directly (commented out), but it didn't help. I used the same code on the main page starter code for this api.

Note: According to this article, I may have this issue if there is another requests file on my system. Unfortunately, I have no other python file with this title.

System Info

  • MacOS Ventura 13.3
  • Attempted BOTH with the same result :
  1. Spyder in Anaconda (using Python 3.9.13)
  2. Jupyterlab (Python 3.9.13)

Part 1: This Code Worked

# import gdeltdoc as gd
# import requests
from gdeltdoc import GdeltDoc, Filters

f = Filters(keyword = "climate change", start_date = "2020-05-10", end_date = "2020-05-11")

gd = GdeltDoc()

Part 2: This Produced the Error

# Search for articles matching the filters
# problem
articles = gd.article_search(f)

AttributeError: module 'requests' has no attribute 'get'

Part 3: This Code Same Error

# Get a timeline of the number of articles matching the filters
# problem
timeline = gd.timeline_search("timelinevol", f)

AttributeError: module 'requests' has no attribute 'get'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant