Peace Atlast
Peace Atlast

Reputation: 11

KeyError: 'xoauth_yahoo_guid'

When I try to establish a connection with the yahoo fantasy api I keep getting this error. This is what I have below.

import yahoo_fantasy_api as yfa
import pandas as pd
from nba_api.stats.endpoints import playergamelog
from nba_api.stats.static import players
import argparse
import datetime
import json
from yahoo_oauth import OAuth2



creds = {'consumer_key': 'username', 
         'consumer_secret': 'consumer_secret', 'league_id': league_id}
with open('authorization_info_template.json', "w") as f:
   f.write(json.dumps(creds))
oauth = OAuth2(None, None, from_file='authorization_info_template.json')

My consumer key, secret and league id are all correct. I am not sure why I keep getting this error.

  File "C:\Users\xxxxx\python_work\new\lib\site-packages\yahoo_oauth\yahoo_oauth.py", line 165, in oauth2_access_parser
    self.guid = parsed_access['xoauth_yahoo_guid']
KeyError: 'xoauth_yahoo_guid'

Upvotes: 0

Views: 104

Answers (1)

Peace Atlast
Peace Atlast

Reputation: 11

To anyone that had the same error, reinstall yahoo_oauth. Once I reinstalled the package it started to work.

Upvotes: 1

Related Questions