import webapp2 works on google-app-engine even though I don't have webapp2 installed

前端 未结 3 2036
一生所求
一生所求 2020-12-17 07:04

When I run the following hellow world program (with the GAE Launcher) it works:

import webapp2

class MainPage(webapp2.RequestHandler):
    def get(self):
           


        
相关标签:
3条回答
  • 2020-12-17 07:29

    Are you using the python27 runtime? If so, webapp2 is available on both the development server, regardless of whether you have it installed, and the production runtime. If you're able to import webapp2 under the old python 2.5 runtime, I would consider this a bug.

    0 讨论(0)
  • 2020-12-17 07:39

    It's not a bug. Appengine SDK includes webapp2 since version 1.6.

    By default, you can not import webapp2 from the terminal because google_appengine is not added to PATH by default.

    Add the following dirs to Python's PATH; C:\Program Files\Google\google_appengine\ and C:\Program Files\Google\google_appengine\lib\ and you will have the same enviroment the SDK provides.

    0 讨论(0)
  • 2020-12-17 07:47

    i dont use the GAE launcher but im pretty sure that if you start your app with the launcher it puts some packages into your pythonpath thats why you can import it in your app.
    i bet you cant import something from the gooogle.appengine.ext or other gae libs from your python prompt but you can in your app.

    0 讨论(0)
提交回复
热议问题