gpt4 book ai didi

python - 存储桶名称必须以数字或字母开头和结尾

转载 作者:行者123 更新时间:2023-12-03 08:30:08 27 4
gpt4 key购买 nike

我正在尝试上传 .sav文件到 firebase 存储。但每次我尝试上传时都会收到此错误:ValueError: Bucket names must start and end with a number or letter.我在网上找到的教程/问题都无法解决此问题。

我这样做的方式是:


os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'credentials.json'
storer = storage.Client()
bucket = storer.get_bucket('gs://project_name.appspot.com/') #I found this on the top of my storage account.

有什么想法吗?

最佳答案

get_bucket 采用不带“gs://”且不带尾部斜杠的存储桶名称(这不是数字或字母,因为错误消息提醒您)。

bucket = storer.get_bucket('project_name.appspot.com')

关于python - 存储桶名称必须以数字或字母开头和结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65365913/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com