嗨,我正在尝试使用谷歌的云视觉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。再次运行代码,它应该要求您重新授权。然后运行代码。

07-28 01:23
查看更多