Search code examples
python-2.7google-app-enginegoogle-cloud-endpointsgae-module

GAE import endpoints "No module named endpoints"


I'm using pycharm to develop appengine. Now i'm trying to use endpoints and I've put

libraries:
- name: pycrypto
  version: latest
- name: endpoints
  version: 1.0

and then in main.py

import endpoints

But it gives me error

No module named endpoints

I can see the endpoints folder inside the GAE library. Anyone can help?

*EDIT: it is just a matter of IDE (pycharm) cant locate endpoints. The app runs fine and okay both in dev server or cloud server. There is a picture just to make it a bit clearer:

Pycharm cant find endpoints reference

Thanks


Solution

  • You need to add {GAE_SDK}/lib/endpoints-1.0, not just the SDK itself. The reason you can import google is because it is directly under {GAE_SDK}. The libraries you specify in app.yaml are laid out differently due to supporting multiple versions. I believe you also need to add {GAE_SDK}/lib/protorpc-1.0/, it's just not showing because there's already an import error.