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

Having trouble running examples/possible geopy issue #61

Open
anna-02 opened this issue Feb 11, 2021 · 1 comment
Open

Having trouble running examples/possible geopy issue #61

anna-02 opened this issue Feb 11, 2021 · 1 comment

Comments

@anna-02
Copy link

anna-02 commented Feb 11, 2021

I am getting the following error message when running parse_single_from_code.py:

Traceback (most recent call last):
File "/Users/annaablove/Desktop/py_test/who.py", line 53, in
extractor = MasterExtractor()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Giveme5W1H/extractor/extractor.py", line 60, in init
environment_extractor.EnvironmentExtractor(),
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Giveme5W1H/extractor/extractors/environment_extractor.py", line 55, in init
self.geocoder = Nominatim(domain=host, timeout=8)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/geocoders/nominatim.py", line 103, in init
Nominatim(user_agent="my-application")
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/geocoders/nominatim.py", line 103, in init
Nominatim(user_agent="my-application")
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/geocoders/nominatim.py", line 103, in init
Nominatim(user_agent="my-application")
[Previous line repeated 487 more times]
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/geocoders/nominatim.py", line 92, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/geocoders/base.py", line 242, in init
self.adapter = adapter_factory(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geopy/adapters.py", line 335, in init
self.session = requests.Session()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 367, in init
self.headers = default_headers()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/utils.py", line 821, in default_headers
return CaseInsensitiveDict({
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/structures.py", line 46, in init
self.update(data, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_collections_abc.py", line 854, in update
if isinstance(other, Mapping):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/abc.py", line 98, in instancecheck
return _abc_instancecheck(cls, instance)
RecursionError: maximum recursion depth exceeded in comparison

I think it has something to do with Nominatim.py, but I am inexperienced with geopy and am having trouble isolating the problem. Any help would be appreciated, thanks!

  • OS: MacOS 10.15.6
  • Python Version 3.9
@ajyl
Copy link

ajyl commented Feb 13, 2021

TL;DR
you can probably do

pip3 uninstall geopy
pip3 install geopy==1.13.0

For repo authors, I think setup.py needs to be updated - I'm seeing that setup.py will install geopy>=1.11.0, which gives me 2.1.0. However, it seems like geopy versions > 2.0 introduces breaking changes. I saw that in requirements.txt that geopy==1.13.0 is specified. I think setup.py needs to be updated accordingly.

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