Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to download nltk data

import nltk
nltk.download()

It shows [SSL:CERTIFICATE_VERIFY_FAILED]. In case of requests one can use verify=False, but what to do here.

UPDATE:

This error persists on Python 3.6, with NLTK 3.0, on Mac OS X 10.7.5:

enter image description here

Changing the index in the NLTK downloader (suggested here) allows the downloader to show all of NLTK's files, but when one tries to download all, one gets another SSL error (see bottom of photo):

enter image description here

like image 687
Teodora kulikov Avatar asked Aug 02 '16 16:08

Teodora kulikov


2 Answers

I had the same problem when trying to configure both nltk and SpaCy. Per the instructions in this question, I was able to overcome the issue. Try running /Applications/Python\ 3.6/Install\ Certificates.command, then retry your NLTK download

like image 145
user3626301 Avatar answered Nov 11 '22 00:11

user3626301


On MacOS 10.12.6 this was solved by entering the following in the bash terminal

pip install certifi
/Applications/Python\ 3.6/Install\ Certificates.command

the usual method of installing nltk corpora then worked for me

import nltk
nltk.download()
like image 45
jnPy Avatar answered Nov 11 '22 01:11

jnPy