gpt4 book ai didi

python - 谷歌云视觉 API : "Request had insufficient authentication scopes."

转载 作者:太空狗 更新时间:2023-10-29 22:21:39 36 4
gpt4 key购买 nike

您好,我正在尝试使用谷歌的云视觉 API,特别是这个例子:https://cloud.google.com/vision/docs/label-tutorial#label_tutorial_1

我遵循了本教程:https://cloud.google.com/vision/docs/getting-started#set_up_a_service_account用于设置服务帐户,但是当我运行我的代码时,我得到:

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://vision.googleapis.com/$discovery/rest?version=v1 returned "Request had insufficient authentication scopes.">

有人可以帮忙吗?我不知道发生了什么,我的代码与教程是 1:1 的。

最佳答案

您需要从计算机中清除 ~/.credentials/sheets.googleapis.com-python-quickstart.json。然后将您的范围定义为 https://www.googleapis.com/auth/drive。再次运行您的代码,它应该要求您重新授权。然后运行您的代码。

关于python - 谷歌云视觉 API : "Request had insufficient authentication scopes.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35846446/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com