首页 > 解决方案 > 提高 SpreadsheetNotFound gspread.exceptions.SpreadsheetNotFound

问题描述

import gspread
from oauth2client.service_account import ServiceAccountCredentials

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

creds = ServiceAccountCredentials.from_json_keyfile_name("Ahmed-2581d46b4a9f.json", scope)
client = gspread.authorize(creds)
sheet = client.open('ahmed').sheet1 
data = sheet.get_all_records()

上面的代码不起作用,错误如下raise SpreadsheetNotFound gspread.exceptions.SpreadsheetNotFound,我该怎么办?

标签: pythonpython-3.xpython-requestsgspreadafoauth2client

解决方案


推荐阅读