尝试在 Python 中导入 Google Cloud Logging 时出现以下错误:
from google.cloud import logging
File "/usr/local/lib/python3.6/site-packages/google/cloud/logging/__init__.py", line 21, in <module>
from google.cloud.logging.client import Client
File "/usr/local/lib/python3.6/site-packages/google/cloud/logging/client.py", line 32, in <module>
from google.cloud.client import ClientWithProject
ImportError: cannot import name 'ClientWithProject'
我让它在一个虚拟环境中运行,在 requirements.txt 中有这个:
google-cloud-logging>=0.20.0