-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
I'm trying to use translate API with API-Key.
But I got error when I follow instruction on instruction of following:
Translate Doc mentioned how to use it:
Error:
client = translate.Client('my API Key is given')
...
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.
I just guess , now only OAuth2 is supported by translate API. Because of some information. Should the Doc updates or am I wrong ?
Env:
- google-cloud-translate (0.22.0)
- Python 2.7.6 on Ubuntu 14.04
- pip 9.0.1
Some information:
On Translate Client Document,
And help(translate.Client)
Help on class Client in module google.cloud.translate.client:
class Client(google.cloud.client.Client)
| Client to bundle configuration needed for API requests.
|
...
| :type credentials: :class:oauth2client.client.OAuth2Credentials
| :param credentials: (Optional) The OAuth2 Credentials to use for the
| connection owned by this client. If not passed (and
| if nohttpobject is passed), falls back to the
| default inferred from the environment.
...
| Methods defined here:
|
| init(self, target_language='en', credentials=None, http=None)