pip and conda behind a proxy
Installing Python packages from behind a firewall comes down to one HTTP proxy setting, exposed three ways in pip and two in conda. Here is each, with the trusted-host trick for TLS-inspecting corporate proxies.
One proxy, several places to set it
pip and conda both fetch over HTTPS, so both want the s4m HTTP endpoint on port 3128, authenticated with USER:PASS. pip exposes the setting three ways: the --proxy flag for a single command, a proxy line in pip.conf for persistence, and the PIP_PROXY environment variable. pip also honours the standard http_proxy / https_proxy variables, so a shell-level export often fixes things without touching pip's own config.
conda has its own config file. Set proxy_servers for http and https with conda config, which writes to ~/.condarc; conda also reads the environment variables. With s4m you point both tools at http://USER:[email protected]:3128. See the proxy page, the sibling npm/yarn guide, and the shared environment-variable guide for how these variables cross tools.
pip and conda, every method
Flag, config file and environment variable for pip; condarc for conda; trusted-host for TLS-inspecting proxies. Replace USER:PASS.
# --- pip: single command --- pip install --proxy http://USER:[email protected]:3128 requests # --- pip: environment variables (whole session) --- export https_proxy="http://USER:[email protected]:3128" export http_proxy="http://USER:[email protected]:3128" pip install requests # --- pip: persistent config (~/.config/pip/pip.conf, or pip.ini on Windows) --- cat > ~/.config/pip/pip.conf <<'CFG' [global] proxy = http://USER:[email protected]:3128 timeout = 30 CFG # --- conda: writes to ~/.condarc --- conda config --set proxy_servers.http http://USER:[email protected]:3128 conda config --set proxy_servers.https http://USER:[email protected]:3128 conda install numpy # --- TLS-inspecting corporate proxy? mark hosts trusted for pip --- pip install --proxy http://USER:[email protected]:3128 \ --trusted-host pypi.org --trusted-host files.pythonhosted.org requests
Pick the right method
How permanent does the setting need to be?
One install
Use pip install --proxy http://USER:[email protected]:3128
Whole session
Export http_proxy and https_proxy. Both pip and conda (and most CLI tools) in that shell use the exit until you unset them.
Permanent per-user
Write the proxy into pip.conf and ~/.condarc so every install is routed automatically without repeating flags.
TLS interception
If a corporate proxy re-signs TLS, pip may reject certificates. Add --trusted-host for pypi.org and files.pythonhosted.org, or install the proxy's CA.
TLS interception, auth and honesty
The most confusing pip failure behind a proxy is not a timeout but an SSL certificate error. That happens when a corporate proxy intercepts and re-signs HTTPS: pip sees an untrusted certificate and refuses. The proper fix is to install the proxy's root CA into your trust store; the quick fix is --trusted-host pypi.org --trusted-host files.pythonhosted.org. s4m's own proxy does not intercept TLS, so you will not hit this with our endpoint — it only forwards your encrypted traffic.
s4m's HTTP proxy is an authenticated datacenter endpoint, metered pay-as-you-go — a clean egress for CI images and developer boxes that must reach PyPI and conda channels from behind a controlled network. It is not a residential proxy and not a package mirror. Encode special characters in your password (@ becomes %40), and set no_proxy for internal package indexes. A 407 means bad credentials — see the 407 guide. When CI needs one allowlisted egress, add a dedicated personal IP; validate any endpoint with the tools.
Questions, answered
How do I set a proxy for a single pip install?
Pass --proxy http://USER:[email protected]:3128 to the pip install command. Nothing persists, which is handy on shared machines; for a permanent setting use pip.conf or the http_proxy env var.
Why does pip fail with an SSL certificate error behind a proxy?
A corporate proxy is likely intercepting and re-signing TLS, so pip sees an untrusted certificate. Install the proxy's root CA, or use --trusted-host pypi.org --trusted-host files.pythonhosted.org. s4m does not intercept TLS, so our endpoint avoids this.
How do I configure conda to use a proxy?
Run conda config --set proxy_servers.http and proxy_servers.https to your proxy URL; it writes to ~/.condarc. conda also honours the http_proxy and https_proxy environment variables.
Do pip and conda need the SOCKS5 or HTTP endpoint?
The HTTP endpoint on port 3128. Both tools fetch packages over HTTPS through an HTTP CONNECT proxy, so point them at http://USER:[email protected]:3128.
Unblock your Python installs
Route pip and conda through the authenticated HTTP endpoint on proxy.s4m.online:3128. Metered pay-as-you-go, no TLS interception, dedicated IP available for CI allowlists.
People found this page by searching for
- pip and conda behind a proxy
- how to check pip and conda behind a proxy
- pip and conda behind a proxy step by step
- pip and conda behind a proxy explained
- pip and conda behind a proxy for android
- how long do free proxies live
- is openvpn safe
- how to set up WireGuard VPN, step by step
- how to fix 429 too many requests when scraping
- proxy for scraping plans
- best vpn kill switch 2026
- download free proxy list
- socks5 proxy with crypto payment
Real search phrases this page answers — the linked ones open the page that covers them in depth.