【问题标题】:Bucket names must start and end with a number or letter存储桶名称必须以数字或字母开头和结尾
【发布时间】:2021-03-29 15:09:24
【问题描述】:

我正在尝试将 .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.

有什么想法吗?

【问题讨论】:

    标签: python firebase google-cloud-platform google-cloud-storage


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2021-02-09
      • 2015-08-03
      • 1970-01-01
      • 1970-01-01
      • 2015-04-17
      • 2020-12-31
      • 1970-01-01
      相关资源
      最近更新 更多