Tag Archives: geopy

How to Solve Geopy library Error: Configurationerror Error

Error details

geopy.exc.ConfigurationError: 
Using Nominatim with default or sample `user_agent` "geopy/2.2.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"`.

Solution:

This error is because the default value of UA is bad. Just specify user-agent as a unique string. For example
, when BuyiXiao initializes Nominatim, specify user-agent.

geolocator = Nominatim(user_agent='BuyiXiao')