当前位置: 代码迷 >> 综合 >> 'tokenizers/punkt/PY3/english.pickle' not found 问题解决
  详细解决方案

'tokenizers/punkt/PY3/english.pickle' not found 问题解决

热度:49   发布时间:2023-11-07 17:18:42.0

已经将punkt下载安装了

Linux安装

sudo mv nltk_data-gh-pages.zip  /usr/lib/
cd /usr/lib/
sudo unzip nltk_data-gh-pages.zip
cd nltk_data-gh-pages/
sudo cp -r  packages/ /usr/share/nltk_data
cd ..
sudo rm -rf nltk_data-gh-pages

使用nltk使用语料库报如下错误

Resource ‘tokenizers/punkt/PY3/english.pickle’ not found.
Please use the NLTK Downloader to obtain the resource: >>>
nltk.download()
Searched in:
-/home/python/nltk_data’
-/usr/share/nltk_data’
-/usr/local/share/nltk_data’
-/usr/lib/nltk_data’
-/usr/local/lib/nltk_data’

修改文件夹权限

因为Pycharm没有权限访问usr/share/下的文件,所以需要修改权限

sudo chmod 777 -R   /usr/share/nltk_data/

解压punkt.zip

cd /usr/share/nltk_data/tokenizers/
sudo unzip punkt.zip

参考

https://blog.csdn.net/tqcai666/article/details/90055302
https://blog.csdn.net/weixin_39031707/article/details/103813092

  相关解决方案