How to add the environment variables in Windows?
See original GitHub issueI cannot figure out how to set the GOOGLE_APPLICATION_CREDENTIALS
on Windows 10.
The documentation is pretty sparse.
I have Node setup OK, and cloned this repo.
I get the following error when running the command node recognize "resources/quit.raw"
Got audio file! Loading speech service… { [Error: 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.] code: 403, errors: [ { message: ‘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.’, domain: ‘global’, reason: ‘forbidden’ } ] }
Why is it looking at the wrong project?
How do I set it to look at my project (I have a google project with speech api enabled)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (2 by maintainers)
Top GitHub Comments
Make sure your
GCLOUD_PROJECT
environment variable is set to your Google project ID.Command prompt:
Powershell:
Hi @sonanhson, I found the solution, use the following code to add the environment variable, it works. But I don’t know yet why the other approaches don’t work.
import os os.environ[“GOOGLE_APPLICATION_CREDENTIALS”] = “path_to_your_.json_credential_file”
This will also be useful when you are switching between projects that need different credentials.