You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用InstalledAppFlow时出现Google Oauthlib Scope has changed报错如何解决

Google API授权Scope变更警告修复方案

该警告触发原因是Google官方已废弃旧版Google Sheets API的scope地址https://spreadsheets.google.com/feeds,授权流程会自动将废弃scope替换为当前有效的https://www.googleapis.com/auth/spreadsheets,两者权限范围完全一致,不会影响功能正常使用,仅做变更提醒。

可通过以下操作彻底清除警告:

  • 找到代码中scopes变量的定义位置,将其中的https://spreadsheets.google.com/feeds替换为https://www.googleapis.com/auth/spreadsheets
  • 删除本地已缓存的授权凭证文件(通常为token.json或类似命名的存储文件),重新执行授权流程即可

修改后的scope配置示例:

scopes = [
    "https://www.googleapis.com/auth/drive",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/gmail.compose"
]

如果修改scope后仍出现警告,可升级google-auth、google-api-python-client等相关依赖到最新版本,排除旧版本库硬编码旧scope的问题。

内容的提问来源于stack exchange,提问作者HuLu ViCa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.12 18:45:03