首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gspread.exceptions.RequestError 404

gspread.exceptions.RequestError 404
EN

Stack Overflow用户
提问于 2021-08-19 14:26:52
回答 1查看 246关注 0票数 1

当从google sheets读取/写入时,会出现以下错误:

代码语言:javascript
复制
gspread.exceptions.RequestError: (404, '404: b\'<!DOCTYPE html>
...
Sorry, unable to open the file at present.</p><p> Please check the address and try again.</p>

代码已经工作了很多年,但在没有任何更改的情况下突然出现了这个错误。以下是代码。我已经创建了一个新的凭据json文件,但它也无法工作。

代码语言:javascript
复制
SCOPES = ['https://www.googleapis.com/auth/spreadsheets', "https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive"]

credentials = ServiceAccountCredentials.from_json_keyfile_name("credentialfile.json", SCOPES)
connection = gspread.authorize(credentials)
worksheet = connection.open(self.sheet).worksheet(tab)

有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2021-08-30 01:36:54

我也有同样的问题。这是因为谷歌方面的一项改变,要求使用sheets API的v4。( @MattKing给我指出答案的链接)

对我有效的解决方案:pip install -U gspread。我的版本是0.6.2,它升级到了4.0.1,在第一次尝试时一切都正常。

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

https://stackoverflow.com/questions/68849726

复制
相关文章

相似问题

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