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

在阿里云的Ubuntu服务器上部署Django项目时遇到了'Resource stopwords not found.'的错误。通过在python3环境下使用NLTK Downloader获取所需资源,然后重启Django项目,成功解决了问题。
摘要由CSDN通过智能技术生成

出现的问题

在阿里云ubuntu服务器布置Django项目中出现如下错误:

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

具体如下所示:

Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/root/.virtualenvs/T/lib/python3.5/site-packages/nltk/corpus/util.py", line 86, in __load
    root = nltk.data.find('{}/{}'.format(self.subdir, zip_name))
  File "/root/.virtualenvs/T/lib/python3.5/site-packages/nltk/data.py", line 701, in find
    raise 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.html

  Attempted to load corpora/stopwords.zip/stopwords/

  Searched in:
    - '/root/nltk_data'
    - '/root/.virtualenvs/T/nltk_data'
    - '/root/.virtualenvs/T/share/nltk_data'
    - '/root/.virtualenvs/T/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/us
  • 6
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值