Failure of timeout or connection when running pip install

if you are trying to install a pip package but getting time out error as below

>pip install --proxy=http://xxx.com:8080 bottle
Defaulting to user installation because normal site-packages is not writeable
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/bottle/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/bottle/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/bottle/
ERROR: Operation cancelled by user
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping

Solution

  • disconnect to your firm wide VPN
  • rerun the installation without proxy settings
>pip install bottle
Defaulting to user installation because normal site-packages is not writeable
Collecting bottle
  Downloading bottle-0.12.25-py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 1.4 MB/s
Installing collected packages: bottle
Successfully installed bottle-0.12.25
WARNING: You are using pip version 21.1.3; however, version 23.0.1 is available.
You should consider upgrading via the 'c:\python39\python.exe -m pip install --upgrade pip' command.

–HTH–

Updated: