问题描述
我已经安装了nltk软件包.之后,我尝试使用nltk.download()下载支持包,但出现错误:
I have installed the nltk package. Following that I am trying to download the supporting packages using nltk.download() and am getting error:
[Errno 11001] getaddrinfo
[Errno 11001] getaddrinfo
我的机器/软件详细信息是:
My machine / software details are:
操作系统:Windows 8.1的Python:3.3.4NLTK软件包:3.0
OS: Windows 8.1Python: 3.3.4NLTK Package: 3.0
以下是在python中运行的命令:
Below are the commands run in python:
Python 3.3.4 (v3.3.4:7ff62415e426, Feb 10 2014, 18:13:51) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
import nltk
nltk.download()
showing info http://nltk.github.com/nltk_data/
True
nltk.download("all")
[nltk_data] Error loading all: <urlopen error [Errno 11001]
[nltk_data] getaddrinfo failed>
False
似乎要转到 http://nltk.github.com/nltk_data/,而理想情况下则应尝试从 http://www.nltk.org/nltk_data/.
在另一台计算机上,当我们键入 http://nltk.github.com/nltk_data/在浏览器中,它重定向到 http://www.nltk.org/nltk_data/.我不明白为什么笔记本电脑上没有进行重定向.
On another machine when we type http://nltk.github.com/nltk_data/ in the browser, it redirects to http://www.nltk.org/nltk_data/. I am not understanding why the redirection is not happening on my laptop.
我认为这可能是问题所在.
I feel that this might be the issue.
请帮助.
我已经添加了命令提示符屏幕截图.需要帮助.
I have added the command prompt screenshot. Need help..
关于,邦森
推荐答案
找到解决方案.我的问题是,当NLTK下载程序启动时,它的服务器索引为- http://nltk.github .com/nltk_data/
Got the solution. The issue in my case was that when the NLTK downloader started it had the server index as - http://nltk.github.com/nltk_data/
这需要更改为- http://nltk.org/nltk_data/
您可以通过进入NLTK Downloader窗口和File-> Change Server Index来更改它.
You can change this by going into the NLTK Downloader window and the File->Change Server Index.
关于,邦森
这篇关于安装nltk支持软件包时出错:nltk.download()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!