首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌工作表应用程序接口在Mac M1 Python上运行缓慢

谷歌工作表应用程序接口在Mac M1 Python上运行缓慢
EN

Stack Overflow用户
提问于 2021-09-08 12:27:24
回答 1查看 67关注 0票数 0

我正在试着从M1 MacBook专业版到google API做一个简单的阅读。

一切都很好,但是做一个简单的阅读需要很长时间,大约需要5-9分钟。

现在,我正试着在我的Windows Pc上做这件事,它工作得很好。

有没有人知道如何解决这个问题,甚至为什么?

代码:

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

发布于 2021-09-20 12:48:04

看起来Sheets API v3从2021年8月2日起就被拒绝了。您应该使用以下作用域之一,而不是当前的scope

代码语言:javascript
复制
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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69103112

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档