[英]How to Auth to Google Cloud using Service Account in Python?
[英]How to set up google cloud account for python?
我创建了一个谷歌云存储桶。
现在我想通过 python 访问它。
我已经在本地安装了google-cloud-storage
槽
pip install google-cloud-storage
我已经定义了所有凭据和存储桶的名称。 这就是我正在做的:
from google.cloud import storage
client = storage.Client()
bucket_id = 'myBucket'
bucket = client.get_bucket(bucket_id)
这是我得到的
DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.