【发布时间】:2012-11-25 03:07:43
【问题描述】:
我正在尝试让 oauth 在 Google App Engine (GAE) 上运行,但我无法导入 OAuth2Decorator,因为它尝试导入 gflags 并失败。
在命令行中,我运行了 help('modules') 并列出了 gflags,我运行了 import os + import gflags + print os.path.dirname(gflags.__file__) 并收到了 /Library/Python/2.7/site-packages/python_gflags-2.0-py2.7.egg。
我在 GAE 开发控制台中运行过:
import sys
import os
try:
import webapp2
import httplib2
from oauth2client.appengine import OAuth2Decorator
except ImportError, e:
print("The import failed!")
print(e)
并收到:
The import failed!
No module named gflags
gflags被from oauth2client.appengine import OAuth2Decorator导入,但是GAE每次运行代码都导入gflags失败。
我不确定这有什么不同,但我运行的是 Mac OS 10.7.5 和 python 2.7.1
【问题讨论】:
标签: google-app-engine python-2.7 oauth-2.0 google-api-python-client gflags