0
votes

I'm trying to deploy my Python Flask app to Google Cloud. It runs fine on my local machine but I get an error when deploying to the cloud. I get "Resource punkt not found". From what I can see, I've set the NLTK_DATA variable to be the correct path. It even shows that nltk is looking in that directory for the punkt folder. I'm deploying with App Engine on Google. Using textblob/nltk for sentiment analysis. The error I'm getting is "textblob.exceptions.MissingCorpusError". I'm stuck now so turning to you guys for help.

env variables and folders

error

1
What are you using to deploy? App engine? Kubernetes? Deployment Manager? - Nicholas Elkaim
Ah I left that bit out. Deploying with App Engine. - Will Helliwell

1 Answers

1
votes

After trying for hours I finally resolved it. I downloaded the nltk directory manually from here, put it in the correct place (has to be where your app.yaml file is) and added the variable path to the app.yaml to be NLTK_DATA: './nltk_data'

app.yaml