1

As the title suggests, punkt isn't found. Of course, I've already import nltk and nltk.download('all').

This still doesn't solve anything and I'm still getting this error:

Exception Type: LookupError Exception Value:
NLTK tokenizers are missing. Download them by following command: python -c "import nltk; nltk.download('punkt')"

I ran nltk.data.path and it output

['/root/nltk_data', '/usr/nltk_data', '/usr/share/nltk_data', '/usr/lib/nltk_data', '/usr/share/nltk_data', '/usr/local/share/nltk_data', '/usr/lib/nltk_data', '/usr/local/lib/nltk_data']

punkit is under /root/nltk_data and I've already checked file permissions.

Anything I'm missing?

jeanggi90
  • 741
  • 9
  • 24
Todd G
  • 33
  • 1
  • 7

2 Answers2

0

Which module have you tried to import from nltk? After importing nltk try to download that module alone using nltk.download('module' )..

Giri
  • 27
  • 3
  • [nltk_data] Downloading package punkt to /root/nltk_data... [nltk_data] Package punkt is already up-to-date! – Todd G Mar 22 '19 at 10:49
  • Try using below ```import nltk nltk.download('punkt') from nltk import word_tokenize```.. Also go thru https://stackoverflow.com/questions/4867197/failed-loading-english-pickle-with-nltk-data-load – Giri Mar 23 '19 at 03:26
0

Turns out the user didn't have permission to access the file.

Answer here: different nltk results in django and at command line

Todd G
  • 33
  • 1
  • 7