简体   繁体   English

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

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

Trying to simply connect to the google-cloud-storage using these instructions;尝试使用这些说明简单地连接到 google-cloud-storage;

https://googleapis.github.io/google-cloud-python/latest/storage/index.html https://googleapis.github.io/google-cloud-python/latest/storage/index.html

However, I keep getting the problem with the storage module, no client attribute.但是,我一直遇到存储模块的问题,没有客户端属性。

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))

This is a problem I've seen several times, and happens as well in other google.cloud modules.这是我见过多次的问题,并且在其他 google.cloud 模块中也会发生。 Most of the time it is related to a broken installation大多数情况下它与损坏的安装有关

Try to uninstall and then installgoogle.cloud packages.尝试卸载然后安装google.cloud 软件包。 If no luck, try to use it on a newly created virtual environment (this will work for sure)如果没有运气,请尝试在新创建的虚拟环境中使用它(这肯定会起作用)

Related git issue with same solution 具有相同解决方案的相关 git 问题

暂无
暂无

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

相关问题 模块 google.cloud 没有属性 storage - module google.cloud has no attribute storage 是否可以在 google.cloud.storage python 客户端中使用 x-goog-if-generation-match? - Is it possible to use x-goog-if-generation-match in google.cloud.storage python client? gsutil 有效。 需要让 google.cloud.storage 工作 - gsutil works. Need to make google.cloud.storage work google.cloud.storage 允许访问但 gcsfs 不允许 - google.cloud.storage allows access but gcsfs does not 错误:模块“google.cloud.bigquery_storage”没有属性“BigQueryReadClient” - Error: module 'google.cloud.bigquery_storage' has no attribute 'BigQueryReadClient' AttributeError: 模块 'google.cloud' 没有属性 'storage' - AttributeError: module 'google.cloud' has no attribute 'storage' AttributeError:模块“ google.cloud.vision”没有属性“ Client” - AttributeError: module 'google.cloud.vision' has no attribute 'Client' 如何在 Python google.cloud.storage 上传方法中访问错误原因? - How to access error reason in Python google.cloud.storage upload methods? 谷歌云存储 python 客户端 AttributeError: 'ClientOptions' object has no attribute 'scopes' 在部署后发生 - Google cloud storage python client AttributeError: 'ClientOptions' object has no attribute 'scopes' occurs after deployment 如何修复AttributeError:在Google Cloud Interactive Shell中运行python时,'module'对象没有属性'Client' - How to fix AttributeError: 'module' object has no attribute 'Client' when running python in Google Cloud Interactive Shell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM