SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

  Kiến thức lập trình

Trying to download nltk packages using nltk.download() on MacOS in India.

Tried this

import nltk
import ssl

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context

nltk.download()

The code runs and opens the NLTK Downloader window but I get the error:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

I have also run the install Certificates.command:

/Applications/Python 3.12/Install Certificates.command ; exit;

I don’t know what to do now. Btw I am running the code on a Jupyter notebook on a virtual environment

New contributor

Aarav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT