简体   繁体   中英

pip install error: Please check proxy URL. It is malformed and could be missing the host - but I'm NOT behind a proxy

Please consider not to flag this question as duplicate since it differs from the problem and solutions given in all these:

Error installing with pip - Please check proxy URL. It is malformed and could be missing the host

Please check proxy URL. It is malformed and could be missing the host

Error during pip install -Please check proxy URL


The thing is that I recently installed Python 3.9.2 x64 on Windows 10, and I tried to use this command:

python.exe -m pip install -U "telegram-upload"

And I get this error message:

ERROR: Could not install packages due to an EnvironmentError: Please check proxy URL. It is malformed and could be missing the host.

But I'm NOT using a proxy. So it is a strange error for me, I don't understand why I get this error message.

How can I pass through this error in order to install the package I need with PIP?.

I finally solved it by creating a new environment variable with name "NO_PROXY":

SETX /S "%COMPUTERNAME%" /U "USERNAME%" "NO_PROXY" "0"

(it seems the value is irrelevant, maybe pip only checks for the existence of this variable name)

Just by reading and trying random things from the docs: https://pip.pypa.io/en/stable/user_guide/ And this issue on their GitHub repo: https://github.com/pypa/pip/issues/2440

My question now is: how is supposed a Windows user or a beginner python user would figure out all this????.

I mean, I don't think that this problem only occurs to me, because I just did a fresh Python install on a fresh Windows 10 OS with a home network with no proxy no vpn not anything strange, and on this fresh scenario I had no way to install a package using pip because it falsely detected me behind a proxy when I'm really not... so why Python devs team provide a Python installer for Windows if it does not try to figure network settings to avoid weird errors and to make the end-user experience good, clear and easier?.

If a proxy or no_proxy environment variable must be specified always in order to use pip correctly then the Python installer should at least advise about it since installing modules is one of the most common things a programmer will do when using python. I'm very dissappointed with all the time and effort that Python wasted my time just for having a weird, false positive error in the very basic and very early usage of this programming language.

Things should be clear and automated by the Python installer, not expecting that the beginner user to go to the pip docs to figure out how to solve unexpected errors in their very first usage.

Anyways, problem solved, now I can install any package having set the NO_PROXY environment variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM