When trying to run this line G = ox.graph_from_place(‘Piedmont, CA, USA’, network_type=’drive’) I get this error:
JavaScript
x
2
1
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)')))
2
I googled and found this could be a solution but I got the same error message:
JavaScript
1
8
1
from geopy.geocoders import Nominatim
2
geopy.geocoders.options.default_user_agent = 'my_app/1'
3
geopy.geocoders.options.default_timeout = 7
4
geolocator = Nominatim()
5
print(geolocator.headers)
6
{'User-Agent': 'my_app/1'}
7
print(geolocator.timeout)
8
(I changed my/app_1 to “ABC” in the code above)
I also tried – since that was in another solution on stackoverflow, this:
JavaScript
1
2
1
pip install certifi
2
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={})