繁体   English   中英

“google.cloud.storage”问题。 模块没有属性“客户端”

[英]Issue with 'google.cloud.storage'. module has no attribute 'Client'

尝试使用这些说明简单地连接到 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))

这是我见过多次的问题,并且在其他 google.cloud 模块中也会发生。 大多数情况下它与损坏的安装有关

尝试卸载然后安装google.cloud 软件包。 如果没有运气,请尝试在新创建的虚拟环境中使用它(这肯定会起作用)

具有相同解决方案的相关 git 问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM