我很难理解为什么会收到此错误:
Traceback (most recent call last):
File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 299, in _LoadHandlerhandler, path, err = LoadObject(self._handler)
File "/base/alloc/tmpfs/dynamic_runtimes/python27/a7637d5531ec9deb_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 85, in LoadObjectobj = __import__(path[0])
File "/base/data/home/apps/g~email-report-receiver/1.407675116246966578/main.py", line 20, in <module>
from google.auth import app_engine
ImportError: No module named auth
我正在遵循本指南:https://developers.google.com/api-client-library/python/auth/service-accounts (请参阅 Google App Engine标准环境部分)
鉴于我直接从Google指南中复制一行代码:from google.auth import app_engine
并且代码在App-Engine标准环境中运行,为什么我会收到导入错误?
这是我的requirements.txt文件:
google-api-python-client
google-auth
google-auth-httplib2
我的app_engine.py文件:
from google.appengine.ext import vendor
vendor.add('google-auth')
vendor.add('google-auth-httplib2')
vendor.add('google-api-python-client')
仍然得到与上述相同的错误。