アプリケーションのデフォルトの資格情報を認証することができませんし、それは言う:私はドキュメント<a href="https://cloud.google.com/speech/docs/common/auth#set_up_a_service_account" rel="nofollow noreferrer">here</a>を、次の午前
The simplest way for applications to authenticate to a Google Cloud Platform API service is by using Application Default Credentials (ADC). Services using ADC first search for credentials within a GOOGLE_APPLICATION_CREDENTIALS environment variable; Google Cloud recommends you set this environment variable to point to your service account key file (the .json file downloaded when you created a service account key, as explained in Set Up a Service Account.
そして、それは、このコマンドを使用するように書かれています:Googleのシェルでは、私が持っているの
$ export GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_file>
をこれを試みました:
<INSERT_SOMETHING>"~$ $ export GOOGLE_APPLICATION_CREDENTIALS=</Users/grantespanet/Downloads/myfile.json>
このエラーが発生しました:
<INSERT_SOMETHING>:~$ $ export GOOGLE_APPLICATION_CREDENTIALS=/Users/grantespanet/Downloads/myfile.json
を何も、私は、コマンドが正しいファイルの場所を指している知っている
を起こりません:-bash: syntax error near unexpected token newline
また、私はこれを試してみました。アプリケーションの既定の資格情報を正常に認証するにはどうすればよいですか?
"エクスポート"以外のコマンドを実行していますか?輸出が何かをすることを期待していますか? – Fred
私は正直には分かりませんが、私はGoogle翻訳APIを使って翻訳を実装するためにドキュメントに従っていますが、 'gcloud auth application-default login'を使用しました。 @Fred – grant