I'm trying to get google app engine to work on my Raspberry Pi. I keep getting this error.
Traceback (most recent call last):
File "main.py", line 26, in <module>
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
ImportError: No module named google.appengine.ext.webapp.mail_handlers
I downloaded google app engine and then ran these commands:
unzip google_appengine_1.9.40.zip
export PATH=$PATH:/home/pi/google_appengine/
The most trivial solution for such errors is to
import
the required package into you project directory. but to be honest it is not the best way to resolve this one. you may useGoogle App Engine SDK
which will take care of all that headache, or there are another way you can follow:lib
.py
file and name itappengine_config.py
Add the below code snippets into this file:
import sys
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib'))
appengine_config.py
gets loaded every time a new instance is started, and should take care of your modules importing.Regards.
It appears you're trying to directly execute your
main.py
as a standalone application, which is not how GAE app code works.You're supposed to get the development server (from the SDK you downloaded) to execute your app code on your development machine (on GAE it's the GAE infra doing that). See Using the Local Development Server.