Cloud Endpoints - ImportError: No module named endpoints

1k views Asked by At

I'm running into this weird error with a Cloud Endpoints app that I'm just starting to write. I'm not sure if Google changed their libraries or not, but I think this should work?

In my app.yaml I've got...

libraries:
- name: webapp2
  version: "latest"

- name: endpoints
  version: "latest"

And then in my main.py I call:

import endpoints

Result:

ImportError: No module named endpoints

Why would app engine be telling me that endpoints doesn't exist? I can see the endpoints folder in the directory itself...

1

There are 1 answers

0
Ned Lowe On

I got the same thing on a fresh install of the SDK (previously worked).

You need to explicitly add the relevant GAE libraries to your PYTHONPATH.

For example if you're using virtualenvwrapper (you should be):

$ add2virtualenv /path/to/google-cloud-sdk/platform/google_appengine/lib/endpoints-1.0
$ add2virtualenv /path/to/google-cloud-sdk/platform/google_appengine/lib/protorpc-1.0