Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to use the google translation api in my application by following these instructions, but having some trouble setting up the authorisation.

I created the service account, got the json file, and set it in with

set GOOGLE_APPLICATION_CREDENTIALS="C:UsersBassieDocuments.credentialsgoogle-translation-apiMy Project-d885ebbbe907.json"

After running that command I don't see any output, and I don't see a system environment variable called GOOGLE_APPLICATION_CREDENTIALS (is that where it should appear?).

When I try running some basic sample code:

System.InvalidOperationException: 'The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.'

What am I doing wrong?

update

even after manually adding the value to system environment variables, I get the same error.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
798 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...