[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Error from GeoPy #87

Open
dsagman opened this issue Nov 30, 2023 · 1 comment
Open

Error from GeoPy #87

dsagman opened this issue Nov 30, 2023 · 1 comment

Comments

@dsagman
Copy link
dsagman commented Nov 30, 2023

Describe the bug
Error from Geopy: Using Nominatim with default or sample user_agent "geopy/2.4.1" is strongly discouraged, as it violates Nominatim's ToS https://operations.osmfoundation.org/policies/nominatim/ and may possibly cause 403 and 429 HTTP errors.

Error seems to be coming from: /Giveme5W1H/extractor/extractors/environment_extractor.py line 55.

To Reproduce
Fresh install on Mac OS, attempting to run sample code for a single text from the examples directory. Using a virtual env for installing python modules.

Expected behavior
Get 5Ws from sample text.

Log
ConfigurationError: Using Nominatim with default or sample user_agent "geopy/2.4.1" is strongly discouraged, as it violates Nominatim's ToS https://operations.osmfoundation.org/policies/nominatim/ and may possibly cause 403 and 429 HTTP errors. Please specify a custom user_agent with Nominatim(user_agent="my-application") or by overriding the default user_agent: geopy.geocoders.options.default_user_agent = "my-application".

Versions (please complete the following information):

  • OS: Mac OS 14.1.1
  • Python 3.11
  • GeoPy 2.4.1
  • Giveme5W1H 1.10.18
  • Stanford CoreNLP NLTK 3.8.1
@brynkim
Copy link
brynkim commented Jan 29, 2024

I'm not technically sure, but for me this seemed to be an issue derived from geopy.

The exactly same error message can be found in here.

I've solved (maybe?) it by changing line 55 of Giveme5W1H.extractor.extractors.environment_extractor.py file as

self.geocoder = Nominatim(domain=host, timeout=8)

into

self.geocoder = Nominatim(domain=host, timeout=8, user_agent='MY_USER_AGENT')

where MY_USER_AGENT is a random string.

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

2 participants