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

Exception if eventlet is used #55

Open
tito opened this issue Jul 27, 2020 · 1 comment
Open

Exception if eventlet is used #55

tito opened this issue Jul 27, 2020 · 1 comment

Comments

@tito
Copy link

tito commented Jul 27, 2020

If eventlet is used (like if you do something with flask_socketio), the library display lot of Exception during the loading of geocoded file:

>>> import eventlet
>>> eventlet.monkey_patch()
>>> import reverse_geocoder as rg
>>> coordinates = (51.5214588,-0.1729636),(9.936033, 76.259952),(37.38605,-122.08385)
>>> results = rg.search(coordinates) # default mode = 2
Loading formatted geocoded file...
Exception ignored in: <function _after_fork at 0x7f57a9dfba60>
Traceback (most recent call last):
  File "/home/tito/.conda/envs/cozyconnect/lib/python3.7/threading.py", line 1343, in _after_fork
    assert len(_active) == 1
AssertionError: 
Exception ignored in: <function _after_fork at 0x7f57a9dfba60>
Traceback (most recent call last):
  File "/home/tito/.conda/envs/cozyconnect/lib/python3.7/threading.py", line 1343, in _after_fork
    assert len(_active) == 1
AssertionError: 
Exception ignored in: <function _after_fork at 0x7f57a9dfba60>
...
>>> results
[OrderedDict([('lat', '51.51116'), ('lon', '-0.18426'), ('name', 'Bayswater'), ('admin1', 'England'), ('admin2', 'Greater London'), ('cc', 'GB')]), OrderedDict([('lat', '9.93988'), ('lon', '76.26022'), ('name', 'Cochin'), ('admin1', 'Kerala'), ('admin2', 'Ernakulam'), ('cc', 'IN')]), OrderedDict([('lat', '37.38605'), ('lon', '-122.08385'), ('name', 'Mountain View'), ('admin1', 'California'), ('admin2', 'Santa Clara County'), ('cc', 'US')])]
@Alex-ley
Copy link

Alex-ley commented Apr 6, 2022

Did you try with mode=1? Then there will be no multiprocessing, which I assume is causing the issues here?

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