Didn't set proxy but it says proxy is malform
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
- [X] I agree to follow the PSF Code of Conduct.
Can you please share the output of pip config debug in the environment where you're running into this issue?
Can you please share the output of
pip config debugin 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.
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.
It may be worth it to catch proxy exceptions from requests and emit a more specific error message, which suggests to check
pip config debugfor 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:
- In
src/pip/_vendor/requests/adapters.pyat this line ofget_connectionit 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_vendorportion 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. - In
src/pip/_internal/commands/install.pythere is the functioncreate_os_error_messagewhich could be modified to add some lines checking forInvalidProxyURLand providing a suggestion. It could also be possible to add a unit test for that function intests/unit/test_command_install.py.
I think that 2 is the best choice, and probably I would like to try and fix that.