NLTK Downloader to obtain the resource

错误:

LookupError:


Resource punkt not found.
Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download(‘punkt’)

Attempted to load tokenizers/punkt/english.pickle

Searched in:
- ‘C:\Users\tiffa/nltk_data’
NLTK Downloader to obtain the resource

解决思路:

win+R

下载数据包

在Windows的控制台,执行如下命令:
NLTK Downloader to obtain the resource

若下载失败

NLTK Downloader to obtain the resource
NLTK Downloader to obtain the resource
程序打算把 包下载到:C:\Users\tiffa\AppData\Roaming文件夹下面。
但是下载失败了。

所以我,直接把如下的文件下载完毕后,拷贝到C:\Users\tiffa\AppData\Roaming下,即可成功运行程序。

链接:https://pan.baidu.com/s/1xWG2yTXkmw3BFRuOXgS2jQ
提取码:62xn
复制这段内容后打开百度网盘手机App,操作更方便哦

把文件复制过去的样子。

(提醒:把文件下载了之后,可能需要删除掉最外层的空文件夹,需要保证nltk_data的下一级目录就是内容即可。)
NLTK Downloader to obtain the resource

程序成功运行:

NLTK Downloader to obtain the resource