Firebase获取请求:TypeError:__ init __()得到一个意外的关键字参数'strict'

时间:2016-07-02 00:21:55

标签: python firebase python-requests

尝试设置Firebase,此代码会产生错误。我也尝试使用requests进行调用,我得到了完全相同的错误。我正在使用python 3.4。这是怎么回事?

from firebase import firebase
firebase = firebase.FirebaseApplication('https://testDB-72927.firebaseio.com/', authentication=None)
result = firebase.get('/test', None)
print(result)


Traceback (most recent call last):
  File "/Users/Parthenon/Desktop/TestProject/Test.py", line 19, in <module>
    firstFunc(mylist)
  File "/Users/Parthenon/Desktop/TestProject/Test.py", line 14, in firstFunc
    result = firebase.get('/test', None)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/firebase/firebase.py", line 274, in get
    return make_get_request(endpoint, params, headers, connection=connection)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/firebase/firebase.py", line 38, in make_get_request
    response = connection.get(url, params=params, headers=headers, timeout=timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/sessions.py", line 310, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/adapters.py", line 174, in send
    timeout=timeout
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 417, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 232, in _get_conn
    return conn or self._new_conn()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 547, in _new_conn
    strict=self.strict)
TypeError: __init__() got an unexpected keyword argument 'strict'

1 个答案:

答案 0 :(得分:8)

我的请求模块不是最新的。

sudo pip install requests --upgrade