Google App Engine imports prevent running Django console in PyCharm


I'm developing an app with Pycharm 2.7 which will be deployed on Google App Engine. I have two specific imports for GAE:

  • from google.appengine.api import memcache
  • from google.appengine.api.mail import EmailMessage

This works all good when running the local GAE development server, however when I try to run the Django console from within PyCharm (or any task for that matter) via the "Tools" menu and want to test something, the console crashes:

from google.appengine.api import memcache
ImportError: No module named google.appengine.api

I presume it has to do with path settings somehow, however I was unsuccessful to solve this.

Any help is greatly appreciated!
Comment actions Permalink
Right, solved this so hopefully of help to someone who runs into this as well.

I placed the imports in a try: except: construct which allows me to run all tools (consoles, tasks) without breaking from within PyCharm. Not a very nice solution as I suspect there's an issue with path settings somehow but alas... one has to improvise sometimes.

Please sign in to leave a comment.