根据#244帖子中的说明,为了验证凭证,我们可以定义GOOGLE_APPLICATION_CREDENTIALS环境变量来进行直接验证。
以下是我在代码中所做的。
但是当我运行它时,会出现oauth2client.client.HttpAccessTokenRefreshError: invalid_grant错误。有没有解决方法?谢谢。
以下是我在代码中所做的。
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错误。有没有解决方法?谢谢。