已解决(nltk加载停用词词库报错问题)Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:


文章目录

  • 报错代码
  • 报错翻译
  • 报错原因
  • 解决方法
  • 帮忙解决

报错代码

粉丝群里面的一个小伙伴想用nltk加载停用词,在网上复制别人的代码运行的时候发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错代码如下:

from nltk.corpus import stopwordsstop_words = set(stopwords.words('english'))
print(stop_words)

我们可以看到他导包没有任何问题(已经安装了nltk模块):

报错信息内容如下

Traceback (most recent call last):File "D:\Python3.8\lib\site-packages\nltk\corpus\util.py", line 84, in __loadroot = nltk.data.find(f"{self.subdir}/{zip_name}")File "D:\Python3.8\lib\site-packages\nltk\data.py", line 583, in findraise LookupError(resource_not_found)
LookupError:
**********************************************************************Resource stopwords not found.Please use the NLTK Downloader to obtain the resource:>>> import nltk>>> nltk.download('stopwords')For more information see: https://www.nltk.org/data.htmlAttempted to load corpora/stopwords.zip/stopwords/Searched in:- 'C:\\Users\\Administrator/nltk_data'- 'D:\\Python3.8\\nltk_data'- 'D:\\Python3.8\\share\\nltk_data'- 'D:\\Python3.8\\lib\\nltk_data'- 'C:\\Users\\Administrator\\AppData\\Roaming\\nltk_data'- 'C:\\nltk_data'- 'D:\\nltk_data'- 'E:\\nltk_data'
**********************************************************************

报错翻译

报错信息翻译:

找不到资源stopwords。

请使用NLTK下载程序获取资源:

报错原因

报错原因:安装nltk库的时候不会自动安装停用词库,按照下面的方式手动安装即可,博主已经把词库下载好了,自行免费下载领取!!!

解决方法

当时我查阅资料得知,可以自己下载这个数据。根据报错信息提示放到以下任一目录即可(注意:每个人的目录不一定)

我是在Python3.8文件夹下,创建一个nltk_data文件夹,往下在创建一个corpora文件夹,最后把stopwords解压后的文件夹放在corpora文件夹下:D:\Python3.8\nltk_data\corpora:

再次运行程序就可以看到停用词库加载出来了:

博主已经下好了NLTK 常用的三个词库:停用词词库、词性词库。。。关注文末公众号回复:nltk_data,即可领取!!! 下载后放到自己的报错信息的指定文件路径下即可!

关注文末公众号回复nltk_data

帮忙解决

本文已收录于:《告别Bug》专栏

本专栏用于记录学习和工作中遇到的各种疑难Bug问题,以及粉丝群里小伙伴提出的各种问题,文章形式:报错代码 + 报错翻译 + 报错原因 + 解决方法,包括程序安装、运行程序过程中等等问题,订阅专栏+关注博主后如遇到其他问题可私聊帮忙解决!!!

已解决Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:相关推荐

  1. 阿里云服务器出现 Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

    出现的问题 在阿里云ubuntu服务器布置Django项目中出现如下错误: Resource stopwords not found.Please use the NLTK Downloader to ...

  2. 报错 Resource gutenberg not found.Please use the NLTK Downloader to obtain the resource:

    报错信息 **********************************************************************Resource gutenberg not fo ...

  3. Resource stopwords not found. Please use the NLTK Downloader to obtain the r

    命令行键入 python -m nltk.downloader stopwords 一般可以在C:\Users\Administrator\AppData\Roaming\nltk_data\corp ...

  4. 成功解决Please use the NLTK Downloader to obtain the resource:

    成功解决Please use the NLTK Downloader to obtain the resource: 目录 解决问题 解决思路 解决方法 解决问题 Please use the NLT ...

  5. python操作excel报错,Resource gutenberg not found. Please use the NLTK Downloader to obtain the resouce

    用python帮财务室友写了两个操作EXCEL表格读写汇总数据的程序,发现出现如下错误: 在官网http://nltk.org/nltk_data/下载gutenberg这个包(需要翻墙),放到指定路 ...

  6. 已解决mybatis报错:Invalid bound statement (not found)

    已解决mybatis报错:Invalid bound statement (not found) 文章目录 报错问题 解决方法 福利 报错问题 之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一 ...

  7. 已解决org.springframework.beans.factory.UnsatisfiedDependencyException异常的正确解决方法,亲测有效!!!

    已解决org.springframework.beans.factory.UnsatisfiedDependencyException异常的正确解决方法,亲测有效!!! 文章目录 报错问题 解决方法 ...

  8. 已解决org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML异

    已解决org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML异 ...

  9. Vue 中使用 axios 传输数据,当数据量过大时会提示跨域?(√已解决)

    环境 – 前端:Vue-cli 4.3.1 后端:Apache || Nginx+Thinkphp5 今天打算用写一个Markdown编辑器给博客用,然后需要将Markdown原文和解析好的HTML提 ...

最新文章

  1. 70.nodejs操作mongodb
  2. Oracle计划将ZGC项目提交给OpenJDK
  3. Fedora20下安装VLC
  4. 三角形一点到三边距离最小_高中数学:利用正弦定理、余弦定理求解三角形基础题...
  5. SSL / TLS REST服务器–带有Spring和TomEE的客户端
  6. 小型空仓库图片_大中型的食品企业为何都青睐自动化立体仓库?
  7. 网站去色的通用方法(简单)
  8. 销毁Spring Bean的三种方法
  9. cad修改快捷键_怎么编辑CAD快捷键?
  10. Linux 人大金仓安装部署记录
  11. crucible-4.8.2更改mysql5.7数据库报错User ‘crucible‘ has exceeded the ‘max_questions‘ resource
  12. 苹果开发者账号注册、申请续费整个流程
  13. openwrt手工配置pptpd
  14. nginx 访问状态统计 访问控制 虚拟主机
  15. 广西田园及20家子公司引入契约锁电子签章,提升经销商服务效率
  16. 生活中的定律之蝴蝶效应
  17. 职场老司机:能走捷径,为什么不呢?
  18. 代理PW6276,高效同步升压转换芯片
  19. orcle 删除表报正在使用_oracle删除正在连接的用户,解除锁定的表
  20. JS-inArray检查数组中是否存在某个值

热门文章

  1. mac解压rar文件
  2. 学计算机用游戏本好吗,学设计的用什么笔记本好呢
  3. [HNOI2004]高精度开根
  4. Apollo API网关 阿波罗
  5. 服务器无线桥接技巧,两个路由器无线桥接完美教程【图】
  6. 安装固态硬盘后黑屏如何解决?
  7. 看我是怎样捣鼓Linux的
  8. uni-app动画渲染
  9. android 获取全国地址,Android获取所有国家列表
  10. 点击“安全删除硬件并弹出媒体”不显示可删除移动设备