[英]Error in downloading NLTK data: [Errno 11004] getaddrinfo failed
I have installed NLTK module but when I try to install the data I am getting the error below.我已经安装了 NLTK 模块,但是当我尝试安装数据时,出现以下错误。
>>>import nltk
>>> nltk.download('punkt')
[nltk_data] Error loading punkt: <urlopen error [Errno 11004]
[nltk_data] getaddrinfo failed>
False
How should I install the data?我应该如何安装数据?
The issue might be of the Proxy that is setup in the system.问题可能出在系统中设置的代理上。
instead of:而不是:
import nltk导入 nltk
nltk.download() nltk.download()
use:使用:
nltk.set_proxy('SYSTEM PROXY') nltk.set_proxy('系统代理')
nltk.download() nltk.download()
This should solve the problem.这应该可以解决问题。 And to find the proxy of the system: seach proxy in start option of windows.并找到系统的代理:在windows的启动选项中搜索代理。
I understand this is a very old question but wanted to share my experience for anyone who may experience this situation in future.我知道这是一个非常古老的问题,但想与将来可能遇到这种情况的任何人分享我的经验。 What i did was (in windows 10) -我所做的是(在 Windows 10 中)-
set HTTP_PROXY= http://userid:password@proxyurl:port设置 HTTP_PROXY= http://userid:password@proxyurl:port
set HTTPS_PROXY= http://userid:password@proxyurl:port设置 HTTPS_PROXY= http://userid:password@proxyurl:port
set FTP_PROXY= http://userid:password@proxyurl:port设置 FTP_PROXY= http://userid:password@proxyurl:port
python -m nltk.downloader python -m nltk.downloader
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.