Python on macOS: SSL: CERTIFICATE_VERIFY_FAILED unable to get local issuer certificate (run Install Certificates.command)
The python.org installer doesn't use the system keychain, so HTTPS requests fail until you install its CA bundle.
SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: unable to get local issuer certificate Python macOSurllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]>Install Certificates.commandpython.org certificates macOS Meaning
Run /Applications/Python 3.x/Install Certificates.command (installs certifi and links it), or pip install --upgrade certifi and set SSL_CERT_FILE=$(python -m certifi). Don't disable verification with verify=False.
Common causes
- python.org build without the certificates installed
- Outdated certifi
- Corporate proxy root not in certifi
- Virtualenv created before installing certificates
- Wrong
SSL_CERT_FILE
⚡ Quick fix
- Run
Install Certificates.command pip install --upgrade certifi- Export
SSL_CERT_FILE=$(python -m certifi)
Detailed fix by platform
Shell
- bash
/Applications/Python\ 3.12/Install\ Certificates.command pip install --upgrade certifi export SSL_CERT_FILE=$(python -m certifi)
How to diagnose
- Installer — python.org?
- certifi — Current?
- Proxy CA — Added?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ACM region CloudFront can't use my ACM certificate: it must be requested in us-east-1 (N. Virginia)
- Apple Mail Apple Mail: Cannot Send Message — the SMTP server connection failed / password incorrect
- certifi requests SSLError: CERTIFICATE_VERIFY_FAILED because certifi is outdated (missing a new root CA)
Most viewed in SSL / TLS
- DST Root CA X3 expired (old clients fail) Old clients: certificate has expired — Let's Encrypt chain uses expired DST Root CA X3 (OpenSSL 1.0.x, Android < 7.1.1)
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
- Challenge failed for domain Let’s Encrypt / Certbot: Challenge failed for domain example.com — Invalid response from http://example.com/.well-known/acme-challenge/x: 404
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026