SpreadsheetNotFound:如何授权gspread电子邮件帐户

时间:2018-11-27 01:02:33

标签: python gspread

我有以下代码:

import gspread as gs
import gspread_dataframe as gd
from oauth2client.service_account import ServiceAccountCredentials

scope = ['https://spreadsheets.google.com/feeds',
         'https://www.googleapis.com/auth/drive']

path_cred = '0_Credentials/dashboard-7ebfec2b3590.json'

credentials = ServiceAccountCredentials.from_json_keyfile_name(path_cred, scope)

file = gs.authorize(credentials)

ws = file.open("output_forecast").worksheet("summary")

最后一行运行时,它给了我这个错误:

SpreadsheetNotFound

我遵循了在线+堆栈溢出响应的说明,该响应表示要与客户端电子邮件共享电子表格(来自以“ iam.gserviceaccount.com”结尾的json凭据)。我这样做了,但仍然遇到错误。

0 个答案:

没有答案