I recently downloaded geopy and tested it out on Jupyter's notebook with the code below.
import geopy
from geopy.geocoders import Nominatim
nom=Nominatim(scheme="http")
After running this I received the following error:
---------------------------------------------------------------------------
ConfigurationError Traceback (most recent call last)
<ipython-input-50-899501bc88f0> in <module>
----> 1 nom=Nominatim(scheme="http")
c:usersabhilash guptaappdatalocalprogramspythonpython39libsite-packagesgeopygeocoders
ominatim.py in __init__(self, timeout, proxies, domain, scheme, user_agent, ssl_context, adapter_factory)
103 if (self.domain == _DEFAULT_NOMINATIM_DOMAIN
104 and self.headers['User-Agent'] in _REJECTED_USER_AGENTS):
--> 105 raise ConfigurationError(
106 'Using Nominatim with default or sample `user_agent` "%s" is '
107 'strongly discouraged, as it violates Nominatim's ToS '
ConfigurationError: Using Nominatim with default or sample `user_agent` "geopy/2.1.0" 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"`.
I tried the same thing on Pycharm and received the same error. Also tried searching around but couldn't seem to find anything pertaining to my problem. Would appreciate the help. Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…