【发布时间】:2016-08-10 18:59:17
【问题描述】:
我将 python 与谷歌云语音 api 一起使用,我在 ubuntu 和 Windows 上完成了“How to use google speech recognition api in python?”中的所有步骤,当我尝试从这里运行简单脚本时 - “https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/api/speech_rest.py”
我得到下一个错误:
<HttpError 403 when requesting https://speech.googleapis.com/$discovery/rest?version=v1beta1 returned "Google Cloud Speech API has not been used in project google.com:cloudsdktool before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/speech.googleapis.com/overview?project=google.com:cloudsdktool then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.">
奇怪的是我没有名为“cloudsdktool”的项目
我运行“gcloud init”,并使用“gcloud auth activate-service-account --key-file=jsonfile”命令链接了我在创建服务帐户密钥时获得的 json 文件, 我尝试在 linux 中创建 google 凭据环境变量,但我仍然得到相同的按摩
【问题讨论】:
-
相关讨论github.com/GoogleCloudPlatform/google-cloud-ruby/issues/706。看起来你需要一个带有 json 文件的身份验证。
标签: python linux google-speech-api