I am using nltk_tokenize in an django app . To do the same I need to do nltk data download so that I can use it for stemming . I am deploying the django app on cloud through Elastic beanstalk .
Right now I have included
nltk.download('punkt')
in the my views so that the required data gets downloaded . But I am getting following error
[Errno 2] No such file or directory: '/home/wsgi/nltk_data'
What is the correct way to do so?
I am not sure what nltk_tokenize is really, but your app is running on Elastic Beanstalk by wsgi user. This is a user that doesn't have a home directory. You need to specify the path to somewhere that exists like /opt/python/current/app (your app's directory in Elastic beanstalk), or /tmp/ or what now would make sense.
Edit: Corrected directory after comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With