0

目前,我正在运行这个 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'

如何解决此错误?

4

1 回答 1

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
于 2020-10-25T06:48:25.377 回答