1

我正在使用 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."
 }
}

知道有什么问题吗?

谢谢

4

1 回答 1

0

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

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

于 2018-06-19T14:16:07.120 回答