首页 > 解决方案 > AttributeError:“str”对象没有属性“apps”

问题描述

我正在尝试使用 gspread 库将 Google Colabs 连接到 Google 电子表格。

我创建了我的 JSON 文件,但出现以下错误:AttributeError: 'str' object has no attribute 'apps'

您将在下面找到我的代码:

import gspread 
from oauth2client.service_account 
import ServiceAccountCredentials
credentials = ServiceAccountCredentials.from_json_keyfile_name("JSON-NAME"-"FILE-NAME".apps.googleusercontent.com.json, links)
gc =gspread.authorize(credentials)

links = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']

有什么我想念的吗?

标签: pythongspread

解决方案


推荐阅读