【问题标题】:Python gspread getting accessNotConfigured - Project (number) is not found and cannot be used for API callsPython gspread 获取 accessNotConfigured - 项目(编号)未找到,不能用于 API 调用
【发布时间】:2018-06-19 10:39:47
【问题描述】:

我正在使用 python 3 和 gspread 库来访问云中的谷歌表格。

使用 相同的凭据和相同的 python 脚本以相同的方式运行)它可以在我的计算机上运行,​​但不能在同一台计算机上的 docker 映像中运行,相同的凭据。有时它使用 virtualenv(相同的 python 版本)工作,但现在在 docker 容器中我无法弄清楚为什么会发生这种情况。相同的凭据 json 配置。

这是我得到的完整错误:

gspread.exceptions.APIError: {
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Project is not found and cannot be used for API calls. If it is recently created, enable Drive API by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "extendedHelp": "https://console.developers.google.com/apis/api/drive.googleapis.com/overvie    w?project="
   }
  ],
  "code": 403,
  "message": "Project is not found and cannot be used for API calls. If it is recently created, enable Drive API by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
 }
}

知道可能出了什么问题吗?

谢谢

【问题讨论】:

    标签: python-3.x docker google-api gspread


    【解决方案1】:

    我发现这是一个兼容性问题(这与使用的 Sheet API 的版本有关。

    我将 gspread 版本从 3 降级到 0.6.2 并且它可以工作。

    【讨论】:

      猜你喜欢
      • 2017-08-31
      • 2012-08-09
      • 1970-01-01
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多