谷歌视频智能python教程:在哪里放置凭证key.json?

2024-10-02 02:38:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经分叉python-doc-sample https://github.com/aliwo/python-docs-samples

我正在学习下面的.py文件。 python docs samples\video\cloud client\labels\标签.py在

出现错误消息:

google.auth.exceptions.DefaultCredentialsError: Could not automatically     determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or
explicitly create credential and re-run the application. For more
information, please see
https://developers.google.com/accounts/docs/application-default-credentials.

我检查了所有的谷歌客户端网站,但找不到我的服务帐户的位置key.json键文件。 如何解决这个错误?在


Tags: 文件samplepyhttpsgithubcomdocsdoc
2条回答

enter image description here

控制面板->;系统环境变量->;设置如下

如果您正在本地计算机上运行代码,您应该能够将key.json键在任何地方归档并按照this page(页面底部)上的“使用应用程序默认凭据进行身份验证”步骤操作。在

具体来说:

$ export GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_file>

相关问题 更多 >

    热门问题