我需要为我的应用程序使用“Google 语音 API”。为此,我安装了“谷歌云存储 SDK”。我按照此链接“ https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu ”安装gcloud。
然后我在终端上运行了这个命令“ set GOOGLE_APPLICATION_CREDENTIALS /path/to/google-speech-API-key/key.json
”来设置 GOOGLE_APPLICATION_CREDENTIALS。但是当我尝试测试时,我得到了这个异常
"Error reading credential file from environment variable GOOGLE_APPLICATION_CREDENTIALS, value '/path/to/google-speech-API-key': File does not exist"
。我确定该目录存在并且它具有所有权限。
然后我运行这个命令"gcloud auth application-default login"
来实际设置默认键。我收到以下警告
"The environment variable [GOOGLE_APPLICATION_CREDENTIALS] is set to:
[/path/to/google-speech-API-key]
Credentials will still be generated to the default location:
[/path/to/.config/gcloud/key.json]
To use these credentials, unset this environment variable before
running your application."
那么,现在我该如何取消设置或覆盖 GOOGLE_APPLICATION_CREDENTIALS?