1

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?.

ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
  • Try this: https://stackoverflow.com/a/55613824/12684122 – olenscki Mar 12 '21 at 16:56
  • I'm NOT using a proxy. What is supposed I should put in the --proxy parameter?. I already tried with "--proxy=LOCALHOST:80" just to try something weird as this weird error message that I'm getting. – ElektroStudios Mar 12 '21 at 16:57
  • `set | fgrep -i proxy` ??? Anything in `pip.conf` ??? `pip config list | fgrep proxy` ??? – phd Mar 12 '21 at 17:33
  • It's a fresh Python install with its default config for everything. I can't find any "pip.conf" file inside the install directory. I'm on Windows, no fgrep command. I'm not much experienced with Python. The output of the command: "pip config list" is empty. – ElektroStudios Mar 12 '21 at 22:15
  • `set | find "proxy"` ??? – phd Mar 12 '21 at 22:31
  • In these docs says the config file in Windows is stored in ROAMING folder: https://pip.pypa.io/en/stable/user_guide/ and it has the name "pip.ini". I tried setting "PIP_HOST = 127.0.0.1" in the ini file (below "[global]" section) but it does not solve the problem, I'm always getting the same weird error message about using a proxy. – ElektroStudios Mar 12 '21 at 22:32
  • No, I don't have any custom environment variable with name "proxy" or containing that text. Thanks for trying to help. – ElektroStudios Mar 12 '21 at 22:33

1 Answers1

1

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 O.S 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.

ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
  • 1
    It's not python's fault, otherwise this issue would've occured to other people. My installation(and I'm sure most other people's) runs perfectly fine without this NO_PROXY variable. Its more likely some esoteric edge case triggered on your environment. – SuperStormer Mar 12 '21 at 23:05
  • In any case, the pip error message was also very unintuitive, it could at least do a suggestion to use the https_proxy/no_proxy env vars when getting this error message, just to try point the user to a solution. – ElektroStudios Mar 12 '21 at 23:08
  • @SuperStormer, your edit was a censor, and you should NOT censor the opinion / reflection of an user. Maybe I was wrong considering this is Python's problem that affects a vast majority of users, but with your first comment alleging the opposite it was clear. – ElektroStudios Mar 13 '21 at 07:41
  • I edited it out because it was irrelevant to the actual answer and just served as clutter. – SuperStormer Mar 13 '21 at 09:55