错误:gspread.exceptions.APIError:{'代码':403,'消息':'呼叫者没有权限','状态':'PERMISSION_DENIED'}

问题描述

我需要将Google驱动器上的数据库加载到笔记本电脑上的pyCharm,我根据此链接设置了所有内容:[https://towardsdatascience.com/how-to-in-integrate-google-sheets-and-jupyter -notebooks-c469309aacea],最后是我的代码

import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pandas as pd
from pandas.io.json import json_normalize
scope = ['https://spreadsheets.google.com/Feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('./my-project-ml-293621-aeb4b147f1ae.json',scope)
gc = gspread.authorize(credentials)
spreadsheet_key = '1uj829biJO-KHk6cXY0KaBx_qm9rbyKYxDB4ssz8rxUs'
book = gc.open_by_key(spreadsheet_key)
worksheet = book.worksheet("weather")
table = worksheet.get_all_values()

但我收到此错误

gspread.exceptions.APIError: {'code': 403,'message': 'The caller does not have permission','status': 'PERMISSION_DENIED'}

任何人都可以帮助我找出我的代码中的问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)