当前,我正在运行以下python脚本:
import pyrebase
# Config the firebase
# Create a stream
# Attatch the streamHandler
# Push the data to the firebase after analysis
config = {
"apiKey": "Yl6***************OigD",
"authDomain": "********.firebaseapp.com",
"databaseURL": "https://****.firebaseio.com",
"storageBucket": "*****.appspot.com",
"serviceAccount": "/Users/ndh/Desktop/ConditioningMaintainanceAnalysis/**************.json"
}
firebase = pyrebase.initialize_app(config)
db = firebase.database()
这给了我以下错误:
File "/Users/ndh/anaconda3/lib/python3.6/site-packages/requests_toolbelt/auth/guess.py", line 6, in <module>
from . import _digest_auth_compat as auth_compat, http_proxy_digest
File "/Users/ndh/anaconda3/lib/python3.6/site-packages/requests_toolbelt/auth/_digest_auth_compat.py", line 17, in <module>
class _HTTPDigestAuth(requests.auth.HTTPDigestAuth):
AttributeError: module 'requests' has no attribute 'auth'
如何解决此错误?
答案 0 :(得分:0)
这对我有用
from Pyrebase import pyrebase
#仅查看C:\ Users \ Agil \ AppData \ Local \ Programs \ Python \ Python39 \ Lib \ site-packages \ Pyrebase中的pyrebase库
或默认的pyrebase库 C:\ Users \ Agil \ AppData \ Local \ Programs \ Python \ Python39 \ Lib \ site-packages \ Pyrebase-master
使用
from Pyrebase-master import pyrebase