1

Hi I have python version 3.9.6 installed and pip version 21.1.3. And I'm trying to run py -m pip install Django and I get the following errors:

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/django/

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/django/

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/django/

WARNING: Retrying (Retry(total=1, 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/django/

WARNING: Retrying (Retry(total=0, 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/django/

Could not fetch URL https://pypi.org/simple/django/: 
There was a problem confirming the ssl certificate: 
HTTPSConnectionPool(host='pypi.org', port=443): 
Max retries exceeded with url: /simple/django/ 
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping

ERROR: Could not find a version that satisfies the requirement Django (from versions: none)
ERROR: No matching distribution found for Django

Can anyone please help me and tell me how to solve this issue.

I tried to turn off my antivirus but it didn't help

I can't use openssl on my cmd if anyone knows how to import Django step by step it would help me very much as I'm new using python.

Thanks.

markwalker_
  • 12,078
  • 7
  • 62
  • 99
Shmiel
  • 1,201
  • 10
  • 25
  • Does this answer your question? [certificate verify failed: unable to get local issuer certificate](https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate) – Michael Ruth Jul 15 '21 at 17:41
  • Try `py -m pip install Django --trusted-host pypi.org` – markwalker_ Jul 15 '21 at 18:33
  • Tried but got following error: `ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/37/a1/790e01bf4348dd68090d47108052a8130954d473d54b4ea7924f5bb154de/Django-3.2.5-py3-none-any.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))` – Shmiel Jul 15 '21 at 20:02

1 Answers1

3

Used this and worked

python -m pip install Django --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

Found it here

Shmiel
  • 1,201
  • 10
  • 25