【发布时间】:2018-11-23 05:30:14
【问题描述】:
我尝试按照我在此处找到的谷歌教程运行下面的代码:https://cloud.google.com/docs/authentication/production
def implicit():
from google.cloud import storage
# If you don't specify credentials when constructing the client, the
# client library will look for credentials in the environment.
project = 'my_project_name'
storage_client = storage.Client(project=project)
# Make an authenticated API request
buckets = list(storage_client.list_buckets())
print(buckets)
implicit()
但它一直给我以下错误:
Traceback (most recent call last):
File "[PATH]/scratch_5.py", line 13, in <module>
implicit()
File "[PATH]/scratch_5.py", line 2, in implicit
from google.cloud import storage
ImportError: cannot import name storage
有人可以帮我解决这个问题吗?
【问题讨论】:
标签: python google-cloud-platform google-cloud-storage