我正在试着从M1 MacBook专业版到google API做一个简单的阅读。
一切都很好,但是做一个简单的阅读需要很长时间,大约需要5-9分钟。
现在,我正试着在我的Windows Pc上做这件事,它工作得很好。
有没有人知道如何解决这个问题,甚至为什么?
代码:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds',]
creds = ServiceAccountCredentials.from_json_keyfile_name("jsonFile.json", scope)
client = gspread.authorize(creds)
sheet = client.open_by_key("Rent").sheet1
data = sheet.get_all_records()
print(data)发布于 2021-09-20 12:48:04
看起来Sheets API v3从2021年8月2日起就被拒绝了。您应该使用以下作用域之一,而不是当前的scope:
https://www.googleapis.com/auth/spreadsheets.readonly
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive更多信息请访问:Sheets API docs
https://stackoverflow.com/questions/69103112
复制相似问题