Pip SSLError WRONG_VERSION_NUMBER under proxy

Viewed 7312

I use Python 3.8.5 with an Anaconda virtual environment. I need to use pip in order to install some python packages in my environment. But for any package installation, I get an error relating a SSL error and a wrong version number :

Ubuntu prompt

Note that my company uses a proxy but variables http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY are all set properly and I have already tried to use the pip option --proxy. I have searched a lot for solutions on different forums but none of its help me to solve my problem. Even if you can't solve it, I would be very grateful if I can have some explanations on this bug. For example :

  • why SSL talks about wrong version number ?
  • Is this problem necessarily linked to the proxy ?

Also note that that my OS is Ubuntu 20.04.

Thanks in advance for your help.

EDIT :

Steffen Ulrich found the problem : the https_variable was set to https://proxy instead of http://proxy. Thanks a lot Steffen !

2 Answers

The https_variable should be set to http://proxy instead of https://proxy

So, before anything else, just run this command:

For Windows:

set https_proxy=http://login:password@address:port

For Ubuntu:

export https_proxy=http://login:password@address:port

For me I have the issue on both Python 3.9 and 3.8 with Windows 10.

The solution for me remarkable as it is was to UNSET the proxy at the Windows level (in internet explorer)

Paste this into Windows + R (run promt) then uncheck all the proxy settings.

rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4

Then in your pip command set the proxy

pip install package --proxy http://proxy:3128

Confirmed a bug exists when system proxy is set pip ignores the command line

Related