我正在尝试运行以下代码:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 495, in callit
func(*args)
File "C:\Python27\lib\site-packages\nltk\downloader.py", line 1914, in _monitor_message_queue
self._select(msg.package.id)
AttributeError: 'unicode' object has no attribute 'id'
Process finished with exit code -805306369 (0xCFFFFFFF)
我得到NLTK下载器,我选择Corpora选项卡并尝试下载wordnet(或任何其他文件)我收到以下错误
<urlopen error [Errno 10109] getaddrinfo failed>
和
(filter #(some #{(:key %)} some-list) list-of-hashmaps)
我认为这是一个网络问题,我该如何解决? (仅供参考,我可以连接到互联网并正常浏览)
答案 0 :(得分:0)
我建议你避免使用Tkinter。您可以从命令行安装语料库,如sudo python nltk.downloader wordnet
。要下载使用本书所需的所有语料库,请执行python nltk.downloader book
。