Python connection error with firebase

3

I'm venturing into python and trying to make a connection by following the following documentation: link

I created it in the firebase:

AndImadethefollowingcodeinpython:

fromfirebaseimportfirebasefirebase=firebase.FirebaseApplication('https://pythoncomfirebase.firebaseio.com/',None)result=firebase.get('/usuario',None)print(result)

Howeveryouareexperiencingthefollowingerrorwhenexecuting:

MuriloCh:PythonMuriloCh$python3/Users/muriloch/Documents/Git/GitHub/Python/firebase/primeiraConexao.pyTraceback(mostrecentcalllast):File"/Users/muriloch/Documents/Git/GitHub/Python/firebase/primeiraConexao.py", line 5, in <module>
    result = firebase.get('/usuario', None)
  File "/Library/Python/3.6/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Python/3.6/site-packages/firebase/firebase.py", line 274, in get
    return make_get_request(endpoint, params, headers, connection=connection)
  File "/Library/Python/3.6/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Python/3.6/site-packages/firebase/firebase.py", line 38, in make_get_request
    response = connection.get(url, params=params, headers=headers, timeout=timeout)
  File "/Library/Python/3.6/site-packages/requests/sessions.py", line 310, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Python/3.6/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/Python/3.6/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/3.6/site-packages/requests/adapters.py", line 174, in send
    timeout=timeout
  File "/Library/Python/3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 417, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/Library/Python/3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 232, in _get_conn
    return conn or self._new_conn()
  File "/Library/Python/3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 547, in _new_conn
    strict=self.strict)
TypeError: __init__() got an unexpected keyword argument 'strict'

Sorry for the starter question, could anyone else help me make the connection?

Note: I'm using the Visual Studio Code in the Sierra macOS.

Current error after using update library ( pip3 install requests --upgrade ):

MuriloCh:Python MuriloCh$ python3 /Users/muriloch/Documents/Git/GitHub/Python/firebase/primeiraConexao.py
Traceback (most recent call last):
  File "/Users/muriloch/Documents/Git/GitHub/Python/firebase/primeiraConexao.py", line 5, in <module>
    result = firebase.get('/usuario', None)
  File "/Library/Python/3.6/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Python/3.6/site-packages/firebase/firebase.py", line 274, in get
    return make_get_request(endpoint, params, headers, connection=connection)
  File "/Library/Python/3.6/site-packages/firebase/decorators.py", line 19, in wrapped
    return f(*args, **kwargs)
  File "/Library/Python/3.6/site-packages/firebase/firebase.py", line 42, in make_get_request
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://pythoncomfirebase.firebaseio.com/usuario/.json
    
asked by anonymous 03.11.2017 / 16:45

0 answers