【发布时间】:2011-11-20 10:00:00
【问题描述】:
我正在运行 Google AppEngine。我安装了 oauth2。我成功地能够在程序中导入 oauth2,但是当我在本地主机上使用 GoogleAppEngine Launcher 运行我的 python 应用程序时,我收到以下错误
ImportError: No module named oauth2
我使用 Python2.7,它不是 GoogleAppEngine 的默认版本,但我在我的项目和 GoogleAppEngine Launcher 中都更改了 python 路径。
【问题讨论】:
-
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app import oauth2 as oauth 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()
-
来自以下链接的代码 - code.google.com/appengine/docs/python/gettingstarted/… with "import oauth2 as oauth"
-
您是否在您的应用中捆绑了 oauth 库?它必须与您的应用一起上传,否则 App Engine 将无法访问它。
标签: google-app-engine oauth-2.0 python-2.7 importerror