python - 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']
有什么我想念的吗?
解决方案
推荐阅读
- html - 如何在网站上添加引导日期选择器?
- flutter - 使用来自未来的回报
作为警报小部件的标题 - c++ - 模板专业化没有匹配的函数调用
- android - 未安装 Node.js。在 Mac 上将 Amplify AWS 添加到 Android Studio
- r - 将值绘制为未堆叠的条形图
- python - Dask Delayed 函数在每次调用时逐渐变慢。不是内存问题
- reactjs - React 从单击的复选框中生成一组 ID
- amazon-web-services - 您可以将 AWS Multi-Attach EBS 卷挂载到 Terraform 中的自动扩展组吗?
- regex - Laravel 中的正则表达式,如何允许 NULL 值
- reactjs - 在 React 上重用组件