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

使用googledrive调用Google API时遇gargle权限不足错误求助

解决Google Drive R包403权限不足错误
  • 注意:gs4_deauth()/gs4_auth()是针对googlesheets4包的认证工具,和googledrive包无关,你之前的操作无法解决当前问题。
  • 按以下步骤修复:
    1. 清除googledrive现有认证状态:
      googledrive::drive_deauth()
      
    2. 重新认证并指定足够的权限范围:
      若需要完整的Drive读写权限,执行:
      googledrive::drive_auth(scopes = "https://www.googleapis.com/auth/drive")
      
      若仅需读取权限,可使用更严格的范围:
      googledrive::drive_auth(scopes = "https://www.googleapis.com/auth/drive.readonly")
      
      执行后会弹出浏览器授权窗口,选择目标账号完成授权即可。
    3. 若使用服务账号认证:
      • 先确认服务账号邮箱已被添加为目标Drive文件夹的协作者(赋予编辑/查看权限)
      • 认证时指定密钥文件和权限范围:
        googledrive::drive_auth(
          path = "你的服务账号密钥文件路径.json",
          scopes = "https://www.googleapis.com/auth/drive"
        )
        
    4. 清理残留缓存:
      如果上述操作仍无效,删除R工作目录下的.gargle文件夹(存储旧认证缓存),再重新执行步骤1-2。

内容的提问来源于stack exchange,提问作者i.b

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 03:03:36