Chatterbot: NLTK SSL Errors loading...

Created on 14 Aug 2017  路  5Comments  路  Source: gunthercox/ChatterBot

I didn't see this directly addressed earlier, but please correct me if I missed it.

I'm receiving these NLTK related errors when running ChatBot (but no issues when I'm coding up NLTK separately on another project.

Any guidance would be wonderful. Thanks guys.

[nltk_data] Error loading stopwords: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed
[nltk_data]     (_ssl.c:749)>
[nltk_data] Error loading wordnet: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed
[nltk_data]     (_ssl.c:749)>
[nltk_data] Error loading punkt: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed
[nltk_data]     (_ssl.c:749)>
[nltk_data] Error loading vader_lexicon: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed
[nltk_data]     (_ssl.c:749)>

Most helpful comment

@sedemmler I don't see any issues on my machine hp pro-book 440 g3

I googled your issue found some answer, i think this could help solve your problem

https://stackoverflow.com/a/41692664/358458
https://stackoverflow.com/a/39142816/358458

However the post suggested workaround related to SSL , i am not sure how this will effect on other platforms? @gunthercox any comments?

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()

All 5 comments

@sedemmler I don't see any issues on my machine hp pro-book 440 g3

I googled your issue found some answer, i think this could help solve your problem

https://stackoverflow.com/a/41692664/358458
https://stackoverflow.com/a/39142816/358458

However the post suggested workaround related to SSL , i am not sure how this will effect on other platforms? @gunthercox any comments?

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()

I appreciate you taking a look. Let me give your suggestion ago tomorrow and I'll let you know how it goes. Thanks!

I'm going to close this ticket off because it hasn't been reported again. I'm assuming it could have possibly been a temporary error on the side of the servers hosting NLTK's data.

@vkosuri Thanks a lot.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings