Python: How do I resolve oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available?
Deborah Swanson
python at deborahswanson.net
Sun Feb 5 20:13:30 EST 2017
MRAB wrote, on February 05, 2017 4:34 PM
>
> On 2017-02-06 00:08, Deborah Swanson wrote:
> > Hi David,
> >
> > Well, I really don't know the first thing about Macs, but it looks
> > like you got the download and environment variable right, at least
> > it's not complaining about that.
> >
> > Looks like the current problem is with the parameters
> you're passing
> > to the build() function. I don't have the apiclient module
> installed,
> > so I can't look at it for myself, but here is the critical error:
> >
> > build() takes at most 2 positional arguments (3 given)
> >
> > This means that you've given too many parameters to
> build(). I'm a bit
> > confused because your youtube_search()code is calling build() with:
> >
> > youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION,
> > developerKey=DEVELOPER_KEY),
> >
> > which is passing 3 arguments,
>
> That's 2 positional arguments and 1 keyword argument.
Well, I said I'm not an experienced python coder, and in this case I've
always seen 'self' as the unspecified argument, but it could be a key
argument. Would be nice to see all of the code and messages. And getting
a look at the build() function would tell it all.
> > and you're using
> >
> > youtube = build(YOUTUBE_API_SERVICE_NAME,
> > GOOGLE_APPLICATION_CREDENTIALS, YOUTUBE_API_VERSION,
> > developerKey=DEVELOPER_KEY),
> >
> > which is passing 4 arguments.
>
> That's 3 positional arguments and 1 keyword argument.
>
> > In either case the error you're getting is
> > complaining that build() only takes 2 arguments, so it's
> not matching
> > up with either youtube_search's code or your call to build().
> >
>
> It's expecting at most 2 positional arguments. Any additional
> arguments
> would have to be keyword arguments.
>
> [snip]
>
If you're right that the error message says build() is expecting 2
positional arguments and 1 keyword argument, then simply dropping the
GOOGLE_APPLICATION_CREDENTIALS argument might just work.
More information about the Python-list
mailing list