【发布时间】: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