小编knh*_*190的帖子

如何修复 Firebase_Admin 错误类型错误:__init__() 得到了一个意外的关键字参数“状态”

我是 Firebase 的新手,我正在在线学习他们的教程。我正在尝试对我用几条记录创建的快速数据库进行身份验证。我收到错误:TypeError: init () got an unexpected keyword argument 'status'

我确保我的 urllib3 是最新的,并确认我的 firebase_Admin 是最新的。我已经检查了 json 文件的文件路径并将我的数据库 URL 复制到其中。

import firebase_admin
from firebase_admin import credentials
from firebase_admin import db

#Generated from settings of a project.
cred = credentials.Certificate(r"Path to json file in the same directory as program")

firebase_admin.initialize_app(cred, {'databaseURL': 'https://mydatabase_from_firebase/'} )
Run Code Online (Sandbox Code Playgroud)

我期待返回 0,确认它有效,但我得到以下错误结果:

TypeError: __init__() got an unexpected keyword argument 'status'
Run Code Online (Sandbox Code Playgroud)

完整的回溯是:

回溯(最近一次调用):文件“C:/Users/Gaming/Firbase_setup/test.py”,第 3 行,来自 firebase_admin 导入数据库文件“C:\Users\Gaming\Firbase_setup\venv\lib\site-packages \firebase_admin\db.py”,第 33 行,来自 firebase_admin import _http_client 文件“C:\Users\Gaming\Firbase_setup\venv\lib\site-packages\firebase_admin_http_client.py”,第 32 行,raise_on_status=False,backoff_factor= 0.5) TypeError: init …

python firebase-admin

9
推荐指数
2
解决办法
4319
查看次数

不可哈希类型:字典中的“列表”

我编写了一些代码来从第二个字典中获取新值并将其添加到新字典中。

这是两本词典:

a = {armani: jeans, dolce: gabbana}
b = {jeans: robo, jobs: versace}
Run Code Online (Sandbox Code Playgroud)

这是代码: {k:b[v] for k,v in a.items() if v in b}

但是,我收到以下错误:unhashable type: 'list'我知道这可能是因为我的值b[v]是这样的[[20], [30], [35]]

在过去的几个小时里,我的头一直在发疯。我确信它是如此之小

python dictionary list python-3.x

2
推荐指数
1
解决办法
4899
查看次数

标签 统计

python ×2

dictionary ×1

firebase-admin ×1

list ×1

python-3.x ×1