firebase-admin-python: Error in loading db module from firebase_admin: "...unexpected arguement 'status'"

Environment:

  • OS X 10.14.3
  • firebase-admin 2.15.1
  • python 3.6.7 with Anaconda

Steps to reproduce:

from firebase_admin import db

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-28-f1634322845c> in <module>
----> 1 from firebase_admin.db import Query

~/anaconda3/lib/python3.6/site-packages/firebase_admin/db.py in <module>
     31 
     32 import firebase_admin
---> 33 from firebase_admin import _http_client
     34 from firebase_admin import _sseclient
     35 from firebase_admin import _utils

~/anaconda3/lib/python3.6/site-packages/firebase_admin/_http_client.py in <module>
     28 DEFAULT_RETRY_CONFIG = retry.Retry(
     29     connect=1, read=1, status=4, status_forcelist=[500, 503],
---> 30     raise_on_status=False, backoff_factor=0.5)
     31 
     32 

TypeError: __init__() got an unexpected keyword argument 'status'

I’ve tried this in a jupyter notebook and in the inline client. Someone else has the error on stackoverflow as well

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

To solve this, I manually installed requests to the latest version before installing firebase_admin. This way, requests already had the latest version of urllib3 and it was able to run just fine.

@michaelspring haha I ended up just removing the old urllib3 from requests

I just commented on Stackoverflow as well. Retry.__init__() definitely accepts a status parameter. It has supported that argument since 1.21.0 release which went out in 2017.

You may have a recent version of urllib3 installed in the system, but that’s not what your Python code/runtime picks up.

Duplicate of #260

Your runtime is picking up an old version of urllib3. You can check which version gets picked by running:

>>> import requests
>>> from requests.packages import urllib3
>>> urllib3.__version__
'1.24.1'