pip-system-certs automatically configures Python to use system certificates via the `truststore` library. It primarily achieves this by monkey-patching `urllib3`, allowing `pip` and other applications utilizing `urllib3` (like `requests`) to respect OS-provided certificate bundles. It is currently at version 5.3 and typically sees several releases per year, often in conjunction with updates to `pip` or its underlying `truststore` dependency.
pip install pip-system-certsVerified import paths — ran on the pinned version, not inferred.
Install `pip-system-certs` into your Python environment. Once installed, it automatically configures `urllib3` (and libraries depending on it, like `requests`) to use system certificates. The quickstart code demonstrates this by making an `https` request to a public website, which should succeed if system certificates are correctly utilized.
Ensure `PIP_CERT` is unset and no `cert` option is configured in `pip.conf` if you intend for pip-system-certs to manage certificates. If custom certificates are needed, manage them manually or through environment configurations.
Upgrade your Python environment to version 3.10 or newer to use `pip-system-certs`.
Be aware of potential conflicts if other packages in your environment perform deep `urllib3` modifications. Test thoroughly when integrating with complex network stack setups. In case of issues, temporarily uninstall `pip-system-certs` to isolate the problem.
Ensure `pip-system-certs` is installed with `pip install pip-system-certs`. If the issue persists, verify your system's certificates are up-to-date and correctly configured, especially in corporate environments where custom root CAs might be required. For Python.org installations on macOS, running 'Install Certificates.command' in your Python directory might help.
The issue is noted as a compatibility problem. Check the `pip-system-certs` GitLab issues for updates and potential fixes. As a temporary workaround, users have reported success by pinning the `requests` library to an earlier version, such as `requests==2.31.0`.
Ensure `pip-system-certs` and `urllib3` are both updated to their latest compatible versions. Check the `pip-system-certs` project's issue tracker for known incompatibilities with specific `urllib3` versions and any recommended solutions or workarounds. This might also arise if other libraries have already monkey-patched `ssl`.
Ensure `pip-system-certs` is installed globally or in the relevant virtual environment (`pip install pip-system-certs`). If still encountering this error when manually trying to use `--use-feature=truststore`, it might indicate an environment issue or a version conflict where `truststore` isn't accessible to `pip`'s bootstrap process. On Python 3.10+, `truststore` is integrated into `pip 24.2+` by default, so ensure `pip` is updated.