【发布时间】:2016-04-24 09:05:39
【问题描述】:
根据下面的帖子#244来认证凭证我们可以定义GOOGLE_APPLICATION_CREDENTIALS环境变量来直接认证。
这是我在代码中所做的。
import gspread
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
credentials.create_scoped(['https://spreadsheets.google.com/feeds'])
gc = gspread.authorize(credentials)
wks = gc.open("hello").sheet1
但是当我运行它时,它会引发 oauth2client.client.HttpAccessTokenRefreshError: invalid_grant
关于如何解决此问题的任何建议?
谢谢,
【问题讨论】: