Skip to content
Advertisement

installed geolocator but ImportError: cannot import name ‘DummyLocator’

I Have installed geolocator and when I use pip install geolocator it returns:

Requirement already satisfied: geolocator in /opt/anaconda3/lib/python3.6/site-packages (0.1.1)

but when I try to import it with import geolocator raises this error:

Fail to execute line 2: import geolocator
Traceback (most recent call last):
File "/tmp/1657524228602-0/zeppelin_python.py", line 158, in <module>
exec(code, _zcUserQueryNameSpace)
File "<stdin>", line 2, in <module>
File "/opt/anaconda3/lib/python3.6/site-packages/geolocator/__init__.py", line 1, in <module>
from geolocator import DummyLocator, MaxMindCityLocator, MaxMindCountryLocator
ImportError: cannot import name 'DummyLocator'

How can I resolve this error?

Advertisement

Answer

Problem solved by installing packages with this order:

pip install geopy
pip install Nominatim
Advertisement