Missing nltk data in python build

I am using the punkt module from the nltk library in python. To use it, imust execute the following command:

import nltk
nltk.download(‘punkt’)

When doing it in my build.sh file, it runs normally, downloads it and unzips the file, the problem comes when the app is in deploy and I try to access the punkt data, I get the following error:

Nov 29 05:47:53 AM Resource punkt not found.
Nov 29 05:47:53 AM Please use the NLTK Downloader to obtain the resource:
Nov 29 05:47:53 AM
Nov 29 05:47:53 AM >>> import nltk
Nov 29 05:47:53 AM >>> nltk.download(‘punkt’)
Nov 29 05:47:53 AM
Nov 29 05:47:53 AM For more information see: NLTK :: Installing NLTK Data
Nov 29 05:47:53 AM
Nov 29 05:47:53 AM Attempted to load tokenizers/punkt/PY3/english.pickle
Nov 29 05:47:53 AM
Nov 29 05:47:53 AM Searched in:
Nov 29 05:47:53 AM - ‘/opt/render/nltk_data’
Nov 29 05:47:53 AM - ‘/opt/render/project/src/.venv/nltk_data’
Nov 29 05:47:53 AM - ‘/opt/render/project/src/.venv/share/nltk_data’
Nov 29 05:47:53 AM - ‘/opt/render/project/src/.venv/lib/nltk_data’
Nov 29 05:47:53 AM - ‘/usr/share/nltk_data’
Nov 29 05:47:53 AM - ‘/usr/local/share/nltk_data’
Nov 29 05:47:53 AM - ‘/usr/lib/nltk_data’
Nov 29 05:47:53 AM - ‘/usr/local/lib/nltk_data’
Nov 29 05:47:53 AM - ‘’
Nov 29 05:47:53 AM **********************************************************************

some ideas?

Hi Alexis,

You mentioned this is downloading and unzipping data during build, is it attempting to save this data to disk?

Would you be able to share a snippet of your build.sh that you’re referring to as well as the service id where you’re getting this error. If you’re not comfortable sharing this is a public forum, feel free to file a support ticket.

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.