Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AttributeError: OAuth2Server instance has no attribute 'oauth'

Dear fitbit community,

 

A year ago I wrote your average python script to download heart-rate datasets from fitbit's servers. Everything worked just fine! I now ran the script again and got an error stating that "OAuth2Server instance has no attribute 'oauth'".

 

So, in my code (as in those based on python-fitbit demos), variable "server" was assigned Oauth2.OAuth2Server(USER_ID, CLIENT_SECRET). And in the past, 

 

print('FULL RESULTS = %s' % server.oauth.token)

 

got me a 

 

FULL RESULTS = {u'token_type': u'Bearer', u'user_id': ...

 

kind of an output. But it now gives me "AttributeError: OAuth2Server instance has no attribute 'oauth'". Naturally, ANY server.oauth ... call gets me the same error. 

 

 

I updated "requests", "requests-oauthlib", and many other pertinent libraries. But I get said error and haven't a clue what to do about it. I appeal to your collective genius! Take pity on a wimp!

 

Trecientos

 

 

 

Best Answer
0 Votes
3 REPLIES 3

Nevermind! Did some comparing between new and old gather_keys_oauth2.py and found the difference. Cheers anyway!

 

T

Best Answer
0 Votes

I have the same error; any chance you could share your solution?

Best Answer
0 Votes

instead of server.oauth.token

try server.fitbit.client.session.token

Best Answer
0 Votes