nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th

问题

使用nltk.download('wordnet')下载不下来要用的包,导致代码加载资源错误

nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第1张图片
nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第2张图片

解决

离线下载NLTK Data
github:nltk_data
将解压文件后得到的packages文件夹
nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第3张图片
目录下面的所有文件(防止再少什么文件报错)
nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第4张图片

按照下图报错中的目录,随意弄一个,比如
nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第5张图片
C:\nltk_data
nltk.download(‘wordnet‘)错误;Resource wordnet not found. Please use the NLTK Downloader to obtain th_第6张图片

你可能感兴趣的:(python,python组件库)