I've pip-installed NLTK, and am trying to download corpora with nltk.download()
. The GUI pops up, but then I get this error, as shown below:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)
There are several questions and answers about this generally, but none of them appear to help if you're running a Python other than the one shipped on python.org. In my case, I'm running a Python 3.6 that I installed through Homebrew, and that inside a virtual environment (using pipenv, if that's relevant). As a result, I do not have any version of Python that comes with the Install Certificates.command
script mentioned in other answers.
This code will eventually run in production, so disabling SSL certificate checking is unacceptable.
Now to the question: Given this setup, what is the right way, reproducibly (i.e., on fresh machines) and without ugly hacks, to overcome this SSL error and download NLTK corpora?