Issue with spaCy library in the new GAE Standard Environment python37 runtime

271 views
Skip to first unread message

BLONDEV INC

unread,
Sep 22, 2018, 12:50:53 PM9/22/18
to Google App Engine

Hi,

I am getting this error message when I make a GET request to my app's URL.

File "/srv/main.py", line 12, in break_sentences nlp = spacy.load('en') File "/env/lib/python3.7/site-packages/spacy/__init__.py", line 15, in load return util.load_model(name, **overrides) File "/env/lib/python3.7/site-packages/spacy/util.py", line 119, in load_model raise IOError(Errors.E050.format(name=name)) OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory." 



I am using the new version of GAE Standard Environment with python37 runtime.

Someone with a similar issue in a different context was able to solve by updating their version of spaCy. It seems that if you install with conda, this issue arises.

Could it be possible that the Google folks used conda to install spaCy to the new Standard Environment and that is why this is happening here?

In any case... Can someone please HELP ME fix this and get my app running properly?

Thanks!

Rahul Ravindran

unread,
Sep 22, 2018, 1:09:53 PM9/22/18
to Google App Engine
We don't use Conda. THis seems like an issue with your application. Can you run this locally successfully?

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9eaffe10-b3ca-446e-ab73-e81394dff2c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BLONDEV INC

unread,
Sep 22, 2018, 2:21:19 PM9/22/18
to Google App Engine
Yes. It works just fine...



PHOTO-2018-09-22-14-17-42.jpg

BLONDEV INC

unread,
Sep 22, 2018, 2:24:43 PM9/22/18
to Google App Engine
Having an issue, however, on another machine using a different environment.
This is a message I got while installing spaCy:

(flask3) ➜  readable001 git:(master) python -m spacy validate

    Installed models (spaCy v2.0.12)
    /Users/rose/WORK/VENVS/flask3/lib/python3.7/site-packages/spacy


    No models found in your current environment.


And then, the error message when I try to run from THIS machine:

OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.


BLONDEV INC

unread,
Sep 22, 2018, 2:43:54 PM9/22/18
to Google App Engine
Then I installed the model I wanted, 

(flask3) ➜  readable001 git:(master) python -m spacy download en
...You can now load the model via spacy.load('en')

and now it works on THIS machine, too...

Snip20180922_106.png





Seems the models for spaCy are not installed in the GAE2 Standard Environment.
We want to use GAE.
Please HELP.

Rahul Ravindran

unread,
Sep 22, 2018, 2:45:47 PM9/22/18
to google-a...@googlegroups.com
So, you cannot install anything outside of requirements.txt into our environment. You could download everything into your source folder and that may work, but if you are attempting to download models and write it some where, that is not supported 

BLONDEV INC

unread,
Sep 22, 2018, 2:51:23 PM9/22/18
to Google App Engine
Well, then, does that mean GAE2 does not support spaCy? What good is it if you can't use the spaCy models? I would think that Google would have installed the models that come with spaCy.

BLONDEV INC

unread,
Sep 22, 2018, 5:58:34 PM9/22/18
to Google App Engine
Hey, I added the model to requirements.txt and made some modifications to account for that. It is now working, if VERY slowly.

Rahul Ravindran

unread,
Sep 22, 2018, 7:04:30 PM9/22/18
to google-a...@googlegroups.com
That is great. Do you mind sharing a sample of your code, requirements.txt and app.yaml in a sample which we could use to look at this usecase?

Additionally, by slow- do you mean every request or the first one? If you could share your image or code, that would help us debut further


Reply all
Reply to author
Forward
0 new messages