报了下面的错误
LookupError: ********************************************************************** 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\\zhq/nltk_data'修改host 文件, 增加 nameserver 8.8.8.8
在cmd里进入python , >>> python >>> import nltk >>> nltk.download() 打开nltk下载器 将下载器里的serverIndex https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml 改为: http://www.nltk.org/nltk_data/在models里找到 punkt, 双击下载 最终发现还是被墙了. 看下载的路径是: https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/tokenizers/punkt.zip 网上找个punkt.zip, 放到电脑对应目录即可. AppData\Roaming\nltk_data\tokenizers