[Django]-'SSLError' installing with pip

11👍

I asked a colleague who automatically knew what to do. I just had to set the proxy variables:

set https_proxy=http://username:password@proxy.example.com:8080
set http_proxy=http://username:password@proxy.example.com:8080

and it works.

👤yannm

57👍

Setting up my proxy correctly fixed this for me as well. The problem was that I used the https protocol for my HTTPS_PROXY and https_proxy environment variables.

Use:

HTTPS_PROXY="http://username:password@proxy.example.com:8080"
https_proxy="http://username:password@proxy.example.com:8080"

Do not use:

HTTPS_PROXY="https://username:password@proxy.example.com:8080"
https_proxy="https://username:password@proxy.example.com:8080"

12👍

My pip was working fine (Windows 7 and Python 3.8.6) until I upgraded pip from version 20.2.1 to 20.3.1, after which I also got the error:

SSL: WRONG_VERSION_NUMBER error.

This is reproducible. I uninstalled and reinstalled several times to confirm.

Solution (well, workaround): don’t upgrade pip to 20.3.1.

Note: pip 20.3.1 works fine in my Windows 7/Python 3.9.1 environment.

👤Mark

4👍

Check your proxy setting. You can use this command

pip install <package> --trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy="<IP>:<port>"

0👍

For me it was the system proxy. The trusted-host flag, to my knowledge, is used when pip wants to query an insecure http index and pip defaults to query only SSL secured indexes.

👤pouya

0👍

Try finding and removing OpenSSL (OS level installation), if it’s installed on your system.

In my case, I installed OpenSSL on Windows 10 (for some other development tasks) long time ago and forgot about it, which was the main culprit. I uninstalled it, and it solved the issue.

👤tayyab

Leave a comment