尝试使用这些指令简单地连接到google-cloud-storage;
https://googleapis.github.io/google-cloud-python/latest/storage/index.html
然而,我总是遇到存储模块的问题,没有客户端属性。
from google.cloud import storage
# Instantiates a client
storage_client = storage.Client(credentials=creds, project='name')
# The name for the new bucket
bucket_name = 'my-new-bucket'
# Creates the new bucket
bucket = storage_client.create_bucket(bucket_name)
print('Bucket {} created.'.format(bucket.name))发布于 2019-03-18 06:36:57
这是我见过几次的问题,在其他google.cloud模块中也会发生。大多数情况下,它与损坏的安装有关
尝试卸载,然后卸载installgoogle.cloud包。如果不走运,试着在新创建的虚拟环境中使用它(这肯定会有效)
https://stackoverflow.com/questions/55212535
复制相似问题