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

Didn't set proxy but it says proxy is malform #12649

Open
1 task done
flamecopper opened this issue Apr 24, 2024 · 4 comments
Open
1 task done

Didn't set proxy but it says proxy is malform #12649

flamecopper opened this issue Apr 24, 2024 · 4 comments
Labels
C: error messages Improving error messages C: proxy Dealing with proxies and networking type: support User Support

Comments

@flamecopper
Copy link

Description

pip3 install flask
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not install packages due to an OSError: Please check proxy URL. It is malformed and could be missing the host.

No proxy is set:
printenv | grep proxy

Expected behavior

No response

pip version

24.0.0

Python version

3.10

OS

Ubuntu

How to Reproduce

Do a simple installation

Output

No response

Code of Conduct

@flamecopper flamecopper added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 24, 2024
@flamecopper flamecopper changed the title Didn't sete proxy but it says proxy is malform Didn't set proxy but it says proxy is malform Apr 24, 2024
@ichard26
Copy link
Member

Can you please share the output of pip config debug in the environment where you're running into this issue?

@ichard26 ichard26 added type: support User Support S: awaiting response Waiting for a response/more information and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Apr 25, 2024
@flamecopper
Copy link
Author

Can you please share the output of pip config debug in the environment where you're running into this issue?

Ok, there is a global.proxy set some where. I remove it and it is working now. Thanks.

@ichard26 ichard26 added C: proxy Dealing with proxies and networking and removed S: awaiting response Waiting for a response/more information labels Apr 27, 2024
@ichard26
Copy link
Member

It may be worth it to catch proxy exceptions from requests and emit a more specific error message, which suggests to check pip config debug for misconfigured proxies.

@ichard26 ichard26 added the C: error messages Improving error messages label Apr 28, 2024
@nucccc
Copy link

nucccc commented May 9, 2024

It may be worth it to catch proxy exceptions from requests and emit a more specific error message, which suggests to check pip config debug for misconfigured proxies.

I could try to add that line in a PR. I have two ideas in mind, the second being the good one I think:

  1. In src/pip/_vendor/requests/adapters.py at this line of get_connection it looks like the Exception is raised. I think it would be enough to modify that string in the exception constructor. But that would mean modifying a _vendor portion of code, I don't know if it's feasible/accepted. Also architecturally, if that comes from an outside library which is integrated, a solution suggestion related to pip shouldn't stay there.
  2. In src/pip/_internal/commands/install.py there is the function create_os_error_message which could be modified to add some lines checking for InvalidProxyURL and providing a suggestion. It could also be possible to add a unit test for that function in tests/unit/test_command_install.py.

I think that 2 is the best choice, and probably I would like to try and fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: error messages Improving error messages C: proxy Dealing with proxies and networking type: support User Support
Projects
None yet
Development

No branches or pull requests

3 participants