Unable to get local issuer certificate when accessing Roboflow API in Jupyter Notebook

Having a certificate issue each time I try to run the below code in a Jupyter Notebook:

from roboflow import Roboflow
rf = Roboflow(api_key=“YOUR API KEY”)
project = rf.workspace(“YOUR-WORKSPACE”).project(“YOUR-PROJECT”)
dataset = project.version(1).download(“yolov7”)

Here’s the error message I get:

requests.exceptions.SSLError: HTTPSConnectionPool(host=‘api.roboflow.com’, port=443): Max retries exceeded with url: /?api_key=dUNehdeJFyYQ1l5x6spo (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

Here’s the message I get upon adjusting the certifi version to 2022.12.7 (which should work with the Roboflow API):

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
roboflow 1.1.0 requires certifi==2022.12.7, but you have certifi 2023.5.7 which is incompatible.

Any thoughts?

Can you give more information about your system and network? My guess would be a missing root certificate on your machine. Or possibly a proxy/VPN messing things up in between you and the server.

Here’s an independent SSL Test showing that the certificate chain is valid and has an A+ security rating: SSL Server Test: api.roboflow.com (Powered by Qualys SSL Labs)

That said, if you absolutely can’t get the SSL config to work, one workaround could be to disable validation of the certificate chain (that links to a hack for how to do it for your script globally using an environment variable and a slightly outdated version of requests) but I’d only do that as a last resort.