# Python on macOS: SSL: CERTIFICATE_VERIFY_FAILED unable to get local issuer certificate (run Install Certificates.command)

**Code:** `macOS` · **Category:** SSL / TLS · **Seen on:** Python, macOS, SSL

The python.org installer doesn't use the system keychain, so HTTPS requests fail until you install its CA bundle.

## 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

1. Run `Install Certificates.command`
2. `pip install --upgrade certifi`
3. Export `SSL_CERT_FILE=$(python -m certifi)`

## Detailed fix by platform

### Shell

1. 

```bash
/Applications/Python\ 3.12/Install\ Certificates.command
pip install --upgrade certifi
export SSL_CERT_FILE=$(python -m certifi)
```


## How to diagnose

1. **Installer** — python.org?
2. **certifi** — Current?
3. **Proxy CA** — Added?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ssl/python-ssl-certificate-verify-failed-macos-install-certificates)
