question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add the environment variables in Windows?

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

34reactions
jmdobrycommented, May 24, 2016

Why is it looking at the wrong project?

Make sure your GCLOUD_PROJECT environment variable is set to your Google project ID.

Command prompt:

set GCLOUD_PROJECT=your-project-id
set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_file.json

Powershell:

$env:GCLOUD_PROJECT="your-project-id"
$env:GOOGLE_APPLICATION_CREDENTIALS="/path/to/service_account_file.json"
23reactions
sakthigeekcommented, Jan 11, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set Environment Variable in Windows {How-To} - phoenixNAP
1. Press Windows + R to open the Windows Run prompt. · 2. Type in sysdm. · 3. Open the Advanced tab and...
Read more >
How to set the path and environment variables in Windows
In the Environment Variables window (as shown below), highlight the Path variable in the System Variable section and click the Edit button. Add...
Read more >
How do I set or change the PATH system variable? - Java
Windows 10 and Windows 8 · In Search, search for and then select: System (Control Panel) · Click the Advanced system settings link....
Read more >
How to Set Environment Variables in Windows 10 - Alphr
How Do I Set Environment Variables in Windows 10? ; Advanced System Settings is open, click on the ; Advanced tab, then look...
Read more >
How to Create an Environment Variable in Windows
How to Create an Environment Variable in Windows · 1.c click advanced system settings. · 2. Select Advanced system settings. · 3. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found