# # 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'
- ''
**********************************************************************
分析:
原因是因为不能把相关的包下载下来(外网访问)
解决:
- 首先把nltk_data包下载下来(资源比较大,**失效请私信 **,百度云链接:链接:https://pan.baidu.com/s/1CiJ71u9a6mSC6Xq_JLiytg ,提取码:k6zf
- 进行解压,把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'
- ''
- 最好不要放在anaconda的python文件夹,因为在虚拟环境创建时找不到,需要重新放在相应目录,建议放在C:\ D:\E:\或者C:\Users\“计算机用户名”/目录下。