SSL error downloading NLTK data

nltk download
pip install nltk punkt
nltk download punkt certificate error
nltk download punkt
nltk download proxy
nltk download stopwords nltk_data error loading stopwords urlopen error ssl
nltk data find corpora
how to install nltk in anaconda

I am trying to download NLTK 3.0 for use with Python 3.6 on Mac OS X 10.7.5, but am getting an SSL error:

import nltk
nltk.download()

I downloaded NLTK with a pip3 command: sudo pip3 install -U nltk.

Changing the index in the NLTK downloader 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):

I am relatively new to computer science and am not at all savvy with respect to SSL.

My question is how to simply resolve this issue?


Here is a similar question by a user who is having the same problem:

Unable to download nltk data

I decided to post a new question with screenshots, since my edit to that other question was rejected.

Similar questions which I did not find helpful:

NLTK download SSL: Certificate verify failed

downloading error using nltk.download()

You don't need to disable SSL checking if you run the following terminal command:

/Applications/Python 3.6/Install Certificates.command

In the place of 3.6, put your version of Python if it's an earlier one. Then you should be able to open your Python interpreter (using the command python3) and successfully run nltk.download() there.

This is an issue wherein urllib uses an embedded version of OpenSSL that not in the system certificate store. Here's an answer with more information on what's going on.

when nltk failed to download nltk-data, it outputs error info to stdout , but I found that, it output the error info to stdout, I thought it may a problem. the error info like: [nltk_data] Error loading punkt: <urlopen error [SSL: [  @memeda, that's interesting.We always thought of the NLTK corpus downloader as being used interactively. Even successful use generates output on stdout. One fix is a flag to specify non-interactive use.

Please see answer by @doctorBroctor. It is more correct and safer to use. Leaving answer below as it might be useful for something else.

https://stackoverflow.com/a/42890688/1167890


This will work by disabling SSL checking.

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

Solve [nltk_data] CERTIFICATE_VERIFY_FAILED] certificate verify , In my python3 environment. >bash /Applications/Python\ 3.6/Install\ Certificates.​command. >python3. >import nltk. >nltk.download('stopwords')  ajax algorithm android attribute c Catalog centos code command css data data base docker Example file Front end function git github golang html html5 ios java javascript linux method mongodb mysql node.js object oracle page parameter php python redis spring springboot sql The server ubuntu user

In Finder, search for Python 3.6. It will appear under Application folder. Expand the Python 3.6 folder. Then install certificates using "Install Certificates.command".

trouble downloading nltk files : learnpython, So I've installed nltk, but when I try to download the files, I get an error message: [nltk_data] CERTIFICATE_VERIFY_FAILED] certificate verify failed I usually have no other files in there except if it does something with data and there's also​  I installed nltk package. Following that I am trying to download the supporting packages using nltk.download() and am getting error: [Errno 11001] getaddrinfo I tried changing server index as sug

To install in codestar only way is manually download modules and save them into nltk_data folder, create a lambda variable environment NLTK_DATA with valie ./nltk_data.

Installing NLTK Data, Apart from individual data packages, you can download the entire collection (​using “all”), or just the data required for the examples and exercises in the book (​  Currently downloading the gh-pages.zip and replacing the nltk_data directory is the working solution for now. Before we find on another channel to distribute nltk_data, please use the above solution. Strangely, it only seems to affect the nltk user account.

SSL error downloading NLTK data, I am trying to download NLTK 3.0 for use with Python 3.6 on Mac OS X 10.7.5, but am getting an SSL error: import nltk nltk.download(). 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.

Python & NLTK Frequently Asked Questions, I get an "SSL error" (screenshot) while trying to download NLTK data. Help! (Mac) If you did not install the data to one of the above central locations, you will need to set the NLTK_DATA environment variable to specify the location of the data. (On a Windows machine, right click on “My Computer” then select Properties > Advanced > Environment Variables > User Variables > New

St4k, Unable to download nltk data files, but when one tries to download all, one gets another SSL error (see python-2.7python-3.xsslnltkosx-lion. I'm trying to learn NLTK - Natural Language Toolkit written in Python and I want install a sample data set to run some examples. My web connection uses a proxy server, and I'm trying to specify the

Comments
  • works like a charm. note: still need to run nltk.download() after this step.
  • @Dany I agree. Updated my answer.
  • how to do this for ubuntu?
  • @FortuneFaded try sh "/Applications/Python 3.6/Install Certificates.command" - The sh at the start and the quotes are important. I thought I didn't have the dir either but it turns out it was the spaces throwing me off.
  • ... which, if you're copying and pasting into Terminal, should end up looking like this: /Applications/Python\ 3.6/Install\ Certificates.command
  • Just a heads up, panlex_lite is pretty big, so it may appear frozen. Check your console for any errors.
  • Also it's a bit buggy, so if it fails, try downloading the remaining packages individually. Or deleting a failed one from ~/ntlk_data folder(zip+ folder) and retry.
  • This worked (except for panlex_lite, which, as you point out, is buggy)! Infinite thanks. Could you explain briefly why I was getting the error and what your code is doing? I guess it's bypassing some kind of SSL security which was preventing me from accessing the GitHub location of the files?
  • This solution worked for me using the homebrew (brew.sh) package manager on macOS 10.13.1
  • Thanks for sharing. This worked for me.
  • Great this helps if you're on a MAC!
  • works perfect. Thank you very much.