首页 > 解决方案 > Jupyter Notebook 和 Gsheet 之间的连接 - 失败 - HttpError 403 错误

问题描述

m completetly new using Google Cloud Platform and APIs so I don不知道如何解决这个问题。我正在尝试将我的 Jupyter 笔记本与谷歌表连接,这样我就可以将 Jupyter 上的数据集连接到 Gsheet。

我建立了所有连接并且没有收到任何错误,在我的最后一步中,我使用了以下代码:

from df2gspread import df2gspread as d2g
wks_name = 'Jupyter Manipulated Data'
    d2g.upload(df_apn1, wks_name, credentials=credentials, row_names=True)

并收到此错误:

HttpError: <HttpError 403 when requesting https://www.googleapis.com/drive/v3/files/root?fields=id&alt=json returned "Insufficient Permission: Request had insufficient authentication scopes.">

t found any solution here that could fix this and, as I said before, I don没有这方面的经验,所以我真的不知道如何解决它。我确保所有应该启用的东西都是这样,所以这不是问题。

有人知道如何解决这个问题吗?

谢谢

标签: apigoogle-sheetsgoogle-cloud-platformjupyter-notebook

解决方案


确保创建的凭据具有正确的范围。可以在此处找到有关使用 Google 表格时范围的具体信息。

这篇中等文章是一个非常好的教程。


推荐阅读