Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python import error "No module named appengine.ext"

Tags:

after runing this code,I found import error:-

from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app  class MainPage(webapp.RequestHandler):     def get(self):         self.response.headers['Content-Type'] = 'text/plain'         self.response.out.write('Hello, webapp World!')  application = webapp.WSGIApplication([('/', MainPage)],debug=True)  def main():     run_wsgi_app(application)  if __name__ == "__main__":     main() 

how to use google.apengine.ext

like image 491
Rajeev Das Avatar asked Apr 03 '13 09:04

Rajeev Das


2 Answers

import sys sys.path.insert(1, '/Users/<username>/google-cloud-sdk/platform/google_appengine') sys.path.insert(1, '/Users/<username>/google-cloud-sdk/platform/google_appengine/lib/yaml/lib') sys.path.insert(1, 'lib')  if 'google' in sys.modules:     del sys.modules['google'] 

this solves the problems for me

like image 158
varun Avatar answered Sep 30 '22 18:09

varun


It looks like the App Engine SDK is not installed, or at least the Python runtime cannot find it.

read and follow the instructions here: https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python

They tell you, how to install App Engine SDK for Python.

like image 40
Jörg Beyer Avatar answered Sep 30 '22 18:09

Jörg Beyer