我需要爲我的應用程序使用「Google語音API」。爲此,我安裝了「Google雲端存儲SDK」。我跟着這個鏈接 「https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu」安裝gcloud。如何在終端中取消設置/覆蓋GOOGLE_APPLICATION_CREDENTIALS環境變量?
然後我在終端上運行這個命令「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?