Skip to content
Advertisement

SSL Error (Port=443) Max retries exceeded when trying to import osmnx data in Jupiter Notebook

When trying to run this line G = ox.graph_from_place(‘Piedmont, CA, USA’, network_type=’drive’) I get this error:

SSLError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&polygon_geojson=1&dedupe=0&limit=50&q=Piedmont%2C+CA%2C+USA (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

I googled and found this could be a solution but I got the same error message:

from geopy.geocoders import Nominatim
geopy.geocoders.options.default_user_agent = 'my_app/1'
geopy.geocoders.options.default_timeout = 7
geolocator = Nominatim()
print(geolocator.headers)
{'User-Agent': 'my_app/1'}
print(geolocator.timeout)

(I changed my/app_1 to “ABC” in the code above)

I also tried – since that was in another solution on stackoverflow, this:

pip install certifi

but the same SSL-error appeared.

I’m using Anaconda Navigator 2.1.1 on Mac (OS Big Sur) and Jupiter Notebook 6.3.0

Can someone tell me what I’m doing wrong please? I’m behind a company proxy and assume that’s the issue.

Advertisement

Answer

Does this URL work in your browser: https://nominatim.openstreetmap.org//search?format=json&polygon_geojson=1&dedupe=0&limit=50&q=Piedmont%2C+CA%2C+USA

you can also set request params: ox.config(request_kwargs={})

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement