You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use the following method without setting environment variables.
from google.cloud import logging
client = logging.Client.from_service_account_json(path of credentials.json)
However, the following error occurs.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/google/cloud/client.py", line 72, in from_service_account_json
return cls(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/logging/client.py", line 107, in __init__
project=project, credentials=credentials, _http=_http)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/client.py", line 213, in __init__
_ClientProjectMixin.__init__(self, project=project)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/client.py", line 169, in __init__
project = self._determine_default(project)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/client.py", line 182, in _determine_default
return _determine_default_project(project)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/_helpers.py", line 181, in _determine_default_project
_, project = google.auth.default()
File "/usr/local/lib/python2.7/dist-packages/google/auth/_default.py", line 285, in default
raise exceptions.DefaultCredentialsError(_HELP_MESSAGE)
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or
explicitly create credential and re-run the application. For more
information, please see
https://developers.google.com/accounts/docs/application-default-credentials.
Is there a way to use without errors?
I do not want to use environment variables, but I want to use the credentials file directly when creating a Client object.
The text was updated successfully, but these errors were encountered:
I would like to use the following method without setting environment variables.
However, the following error occurs.
Is there a way to use without errors?
I do not want to use environment variables, but I want to use the credentials file directly when creating a Client object.
The text was updated successfully, but these errors were encountered: