Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip SSLError WRONG_VERSION_NUMBER under proxy

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 !

like image 682
vincent59 Avatar asked Dec 03 '20 18:12

vincent59


People also ask

How do I get-pip to work behind a proxy server?

pip can be configured to connect through a proxy server in various ways: using the --proxy command-line option to specify a proxy in the form scheme://[user:passwd@]proxy.server:port. using proxy in a Configuration Files. by setting the standard environment-variables http_proxy , https_proxy and no_proxy .

How do you update pip?

Updating Pip When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.


1 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
like image 90
Daniel Avatar answered Sep 27 '22 16:09

Daniel