【发布时间】:2016-03-30 18:04:41
【问题描述】:
我有一个 Python 脚本,我已授权它访问 Google 电子表格。但是现在当我运行它时,它会抛出异常:
oauth2client.client.AccessTokenRefreshError: invalid_client: The OAuth client was not found.
我的验证码如下:
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
json_key = json.load(open('myapp-credentials.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(
json_key['client_email'],
json_key['private_key'], scope)
gc = gspread.authorize(credentials)
我没有更改帐户中的任何内容,所以我不知道为什么它会突然停止工作。如果我登录https://console.developers.google.com/apis/credentials,我看到该应用程序仍在注册。如何诊断并重新启用其访问权限?不幸的是,谷歌搜索这个错误发现了许多潜在的原因。
【问题讨论】:
标签: python google-api google-api-python-client