---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File E:\@@@@\generate_report.py:176, in <module>
170 print('The credentials have been revoked or expired, please delete the '
171 '"%s" file and re-run the application to re-authorize.' %
172 CREDENTIALS_FILE)
175 if __name__ == '__main__':
--> 176 main(sys.argv)
File E:\
@@@@ \generate_report.py:134, in main(argv)
131 with discovery.build('adsense', 'v2', credentials = credentials) as service:
132 try:
133 # Let the user pick account if more than one.
--> 134 account_id = get_account_id(service)
136 # Retrieve report.
137 if saved_report_id:
File E:\
@@@@ \generate_report.py:51, in get_account_id(service)
49 account_id = None
50 response = service.accounts().list().execute()
---> 51 if len(response['accounts']) == 1:
52 account_id = response['accounts'][0]['name']
53 else:
KeyError: 'accounts'