Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure pip3 to ignore proxy settings or do not use proxy settings? #12479

Open
1 task done
honey-speaks-tech opened this issue Jan 15, 2024 · 2 comments
Open
1 task done
Labels
S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior

Comments

@honey-speaks-tech
Copy link

Description

Here is my query. I am using Python 3.8.10. During my laptop setup long time back, I was using proxy settings to work with pip3. I forgot where I have set this. Recently we moved to no proxy. However I am yet to figure where pip3 is taking proxy details from. Bash environment variables for proxy are unset. When I sudo pip3 --proxy "" install conan==1.60.0, I got Connection timeout error. Error excerpt is pasted under output section. I also tried an option "--no-proxy". But it doesn't work as well. Could someone please help me?

Expected behavior

Pip3 shouldn't work behind proxy.

pip version

pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

Python version

python 3.8.10

OS

Ubuntu 20.04 behind WSL (WSL version: 1.2.5.0)

How to Reproduce

  1. Set proxy settings.
  2. Unset proxy settings from bash environment variable.
  3. Verify no pip.ini or pip.conf files exist.
  4. Try sudo pip3 --proxy "" install <any package> from Bash terminal
  5. Error occurs which prevents package installation.

Output

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f8e3bf4ec40>, 'Connection to xx.xx.xx.xx timed out. (connect timeout=15)')': /simple/conan/

Code of Conduct

@honey-speaks-tech honey-speaks-tech added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 15, 2024
@notatallshaw
Copy link
Member

notatallshaw commented Jan 15, 2024

This is a duplicate of #5378, there is an open PR: #12011, it is not yet part of Pip.

Long story short, this is a known limitation of the requests library that for Pip to support it must implement a workaround (which is what the PR does).

A pragamatical workaround is to create a proxy on your own machine which doesn't use the proxy you want to avoid, and point Pip to your own proxy, I have had to do this in the past and used px-proxy (which gives full instructions on how to setup without Pip): https://github.com/genotrance/px#px

@honey-speaks-tech
Copy link
Author

Ok, Thanks. Fortunately I could resolve this using conan Ubuntu installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants