Python on macOS: 'SSL: CERTIFICATE_VERIFY_FAILED unable to get local issuer certificate'
@devsingh05▲ 13 net votes
The python.org macOS installer ships its own OpenSSL without the system root certificates. Run the bundled script once: open /Applications/Python 3.x/ and double-click 'Install Certificates.command' (it installs certifi and links it). Alternatively install Python via Homebrew or uv. Do not 'fix' it with verify=False in production code. Behind a corporate or campus proxy that intercepts TLS, point REQUESTS_CA_BUNDLE / SSL_CERT_FILE at that CA instead.