简体   繁体   中英

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?

Problem solved by installing packages with this order:

pip install geopy
pip install Nominatim

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM