我试图添加 GAE StackDriver 日志记录功能: https ://cloud.google.com/logging/docs/reference/libraries#client-libraries-resources-python
...到我正在运行的一个简单的 Web 服务,并且收到以下错误:
ERROR 2017-02-01 02:46:05,320 - root - Traceback (most recent call last):
File "/home/ubuntu/workspace/.../bootstrap.py", line 11, in <module>
from app import create_app
File "/home/ubuntu/workspace/.../app/__init__.py", line 31, in <module>
from handlers.hdl_logger import blpLog
File "/home/ubuntu/workspace/.../app/handlers/hdl_logger.py", line 15, in <module>
from google.cloud import logging
File "/usr/local/lib/python2.7/dist-packages/google/cloud/logging/__init__.py", line 18, in <module>
from google.cloud.logging.client import Client
File "/usr/local/lib/python2.7/dist-packages/google/cloud/logging/client.py", line 32, in <module>
from google.cloud.client import JSONClient
File "/usr/local/lib/python2.7/dist-packages/google/cloud/client.py", line 17, in <module>
import google.auth.credentials
ImportError: No module named auth.credentials
我让所有这些都在虚拟环境中运行。我仔细查看了依赖项、权限,并检查了 dist-packages/google/ 目录以确认 auth 包在其中。
非常感谢任何帮助故障排除。