Connection Broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] Certificate Verify Failed (_Ssl.c:777)’

  • Home /
  • Blog Posts /
  • Connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)’

This happens when your machine does not have the correct certificate bundle to access the Pypi repository, or you are behind a corporate proxy that just loves to block everything!

An easy way to get around this is to edit (or create) a local pip.conf file under your home directory:

~/.pip/pip.conf

Put the following in:

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

As you can see, we have changed the download location to a mirror that doesn’t use HTTPS, so there will be no certificate issues.

Do note that this is NOT a general long term option, but rather something you can use to get the job done if you are well and truly stuck!