Google Cloud vision API:“请求的认证范围不足”。 [英] Google Cloud vision API: "Request had insufficient authentication scopes."
问题描述
您好我正在尝试使用谷歌的云视觉API,特别是这个例子: https://cloud.google.com/vision/docs/label-tutorial#label_tutorial_1
我遵循本教程:设置服务帐户,但是当我运行我的代码时,我得到:
googleapiclient.errors.HttpError:< HttpError 403请求https时: //vision.googleapis.com/$discovery/rest?version=v1返回请求的身份验证范围不足。>
任何人都可以帮忙吗?我无法弄清楚发生了什么事,我的代码与教程是1:1。
你需要清理〜/ .credentials / sheets.googleapis.com-python-quickstart.json
。然后将您的范围定义为 https://www.googleapis.com/auth/drive
。再次运行您的代码,它应该要求您重新授权。然后运行你的代码。
Hi I'm trying to use google's cloud vision API, specifically this example: https://cloud.google.com/vision/docs/label-tutorial#label_tutorial_1
I followed this tutorial: https://cloud.google.com/vision/docs/getting-started#set_up_a_service_account for setting up a service account but when I run my code I get:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://vision.googleapis.com/$discovery/rest?version=v1 returned "Request had insufficient authentication scopes.">
Can anybody help? I can't figure out what's going on, my code is 1:1 with the tutorials.
You need to clean ~/.credentials/sheets.googleapis.com-python-quickstart.json
from your computer. Then define your scope as https://www.googleapis.com/auth/drive
. Run your code again, it should ask you to re-authorize. Then run your code.
这篇关于Google Cloud vision API:“请求的认证范围不足”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!