Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
186 views
in Technique[技术] by (71.8m points)

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

enter image description here

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

enter image description here

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...