Interview Prep/Python for DevOps/Environments, imports & packaging errors

`pip` hangs or fails with `Could not fetch URL https://pypi.org/simple/...: There was a problem confirming the ssl certificate` behind the corporate proxy.

IntermediateTroubleshootingEnvironments, imports & packaging errors
Answer

Likely causes → A TLS-intercepting proxy presents a corporate CA that pip's bundled certificates do not trust, or the proxy is not configured.

Diagnose →

echo $HTTPS_PROXY $PIP_CERT
pip install requests -v 2>&1 | grep -i "ssl\|proxy"
openssl s_client -connect pypi.org:443 -showcerts </dev/null | head -20

Fix → pip config set global.cert /etc/ssl/certs/corp-ca.pem (or PIP_CERT), set HTTPS_PROXY, or use the internal mirror via PIP_INDEX_URL. Recent pip versions can also use the OS trust store via truststore.

Prevent → Bake the corporate CA and index config into base images and runner setup.

All Python for DevOps questions Roadmap: Python for automation

More on Environments, imports & packaging errors