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

# # NLTK资源地址已更新

场景:

使用nltk库的时候找不到资源,即:Resource xxx not found.Please use the NLTK Downloader to obtain the resource:


描述:

问题如下:

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

  >>> import nltk
  >>> nltk.download('punkt')
  
  For more information see: https://www.nltk.org/data.html

  Attempted to load tokenizers/punkt/english.pickle

  Searched in:
    - 'C:\\Users\\“计算机用户名”/nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\share\\nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\lib\\nltk_data'
    - 'C:\\Users\\“计算机用户名”\\AppData\\Roaming\\nltk_data'
    - 'C:\\nltk_data'
    - 'D:\\nltk_data'
    - 'E:\\nltk_data'
    - ''
**********************************************************************

分析:

原因是因为不能把相关的包下载下来(外网访问)


解决:

  1. 首先把nltk_data包下载下来(资源比较大,**失效请私信 **,百度云链接:链接:https://pan.baidu.com/s/1CiJ71u9a6mSC6Xq_JLiytg ,提取码:k6zf
  2. 进行解压,把nltk_data文件放入一下文件任何位置:
    - 'C:\\Users\\“计算机用户名”/nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\share\\nltk_data'
    - 'D:\\program\\anaconda3\\envs\\torch1.1.0\\lib\\nltk_data'
    - 'C:\\Users\\“计算机用户名”\\AppData\\Roaming\\nltk_data'
    - 'C:\\nltk_data'
    - 'D:\\nltk_data'
    - 'E:\\nltk_data'
    - ''
  1. 最好不要放在anaconda的python文件夹,因为在虚拟环境创建时找不到,需要重新放在相应目录,建议放在C:\ D:\E:\或者C:\Users\“计算机用户名”/目录下。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值