So, I found two ways to fix this problem:
1 - if you use google cloud sdk and cloud speech is in beta, you need to run "gcloud beta init" instead of "gcloud init" and then provide a json file
2 - if you do not want to use cloud sdk from google, you can transfer the json file directly to the python application
Here are the methods for doing this:
from oauth2client.client import GoogleCredentials GoogleCredentials.from_stream('path/to/your/json')
then you simply create a scope on credits and authorization or, if you use grpc (streaming), you pass it to the header, as in the example.
Here are the modified scripts for grpc:
def make_channel(host, port): """Creates an SSL channel with auth credentials from the environment."""
source share