For a single installation, pip accepts a proxy directly on the command line. You can try a route without writing a permanent user or system configuration file:

python -m pip --proxy http://203.0.113.10:8080 install requests

Use an endpoint selected from your service or the HTTP proxy list instead of the documentation IP. Running python -m pip also makes the intended Python environment clearer than assuming that a separate pip executable belongs to it.

The proxy URL describes the proxy connection. It can begin with http:// while the package index and downloads use HTTPS through CONNECT.

If pip keeps choosing another setting

For pip's own options, command-line arguments override environment variables, which override configuration files. Relevant files can exist at global, user, or virtual-environment level. PIP_CONFIG_FILE can select an additional configuration file.

python -m pip config debug

This lists the configuration sources pip considers. Review it locally: files or environment values can contain private URLs or credentials.

Also inspect PIP_PROXY and the ordinary HTTP/HTTPS proxy environment variables. These are not all the same configuration layer, and standard proxy environment handling can still matter when diagnosing the actual network route. Do not assume that deleting one user-file entry removed every possible source.

A proxy option does not repair certificate trust

If the route reaches an HTTPS service but verification fails, find out which certificate the client received. An authorized inspection setup may require an approved CA bundle:

python -m pip --proxy http://203.0.113.10:8080 \
  --cert /path/to/approved-ca-bundle.pem install requests

--trusted-host marks a host trusted even without valid HTTPS. It does not configure the proxy's IP, and it should not be the routine response to a certificate error. Correct the endpoint or trust configuration instead.

pip 24.2 introduced system certificates alongside certifi as the default on supported runtimes. Earlier pip did not automatically use the operating system's CA store. That difference can explain why an approved organization CA works in one Python environment but is missing from another.

The one-command proxy argument disappears after the command finishes. If you later save a persistent proxy setting, put it at the scope you actually intend, rather than making every Python environment depend on an endpoint you were only testing.

Artihkkalat mat laktásit