1
votes

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
What is your python files name? - user1767754
I called it endpoints.py, but changed it back to main.py. Now I'm getting ImportError: No module named endpoints ... Hm... Again, odd. - Kris
you probably have not all packages completely installed. - user1767754
Its strange, because I have another completed endpoints app in my SDK, which runs just fine. When I copy and paste some of the code over into the new project just as a test, I get the same module error... - Kris
maybe the environment pathes are not available in both setups - user1767754

1 Answers

0
votes

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