Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm: set environment variable for google service account key (json credential)

I want to run the google cloud speech python sample in my pycharm.

But encountered the

ApplicationDefaultCredentialsError: 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.

And I tried this solution but it doesn't work. Can anyone help me? Thanks!

PS: The google sample can run in the terminal well.

like image 996
SHI Zhong Ping Avatar asked Oct 04 '16 02:10

SHI Zhong Ping


1 Answers

Well I found the solution myself,

Based on the ver 2016.2.3

Run->Edit Configurations->Environment variables->add ur credential path in the "..." window

like image 85
SHI Zhong Ping Avatar answered Nov 13 '22 07:11

SHI Zhong Ping