gpt4 book ai didi

linux - 谷歌 API OAuth2.0 quickstart.py

转载 作者:太空宇宙 更新时间:2023-11-04 10:19:59 25 4
gpt4 key购买 nike

当我使用 Google API 中提供的 Quickstart.py 代码示例时,出现此错误。关于为什么会产生此错误的任何想法?链接:https://developers.google.com/google-apps/calendar/quickstart/python(我已经更新了 oauth2cilent 模块)

/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/_helpers.py:255: UserWarning: Cannot access
storage.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "/home/akhil/Desktop/TIME_SCHEDULE_UPDATER/quickstart.py", line
16, in <module>
flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/client.py", line 2134, in
flow_from_clientsecrets
cache=cache)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 126, in _loadfile
return _validate_clientsecrets(obj)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 101, in
_validate_clientsecrets
prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property
"redirect_uris" in a client type of "web".

最佳答案

在您的 client_secret.json 文件中,在末尾添加 redirect_uris block 。你的文件应该是这样的:{"web":{"client_id":"foo","project_id":"bar","auth_uri":"foo","token_uri":"bar","auth_provider_x509_cert_url":"foo","client_secret": "bar", "redirect_uris":"http://domain_name _where_you_want_to_redirect/"}}

关于linux - 谷歌 API OAuth2.0 quickstart.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44312994/

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