Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As per step 3, unable to authenticate #22

Open
digdeep opened this issue Dec 18, 2015 · 7 comments
Open

As per step 3, unable to authenticate #22

digdeep opened this issue Dec 18, 2015 · 7 comments
Labels

Comments

@digdeep
Copy link

digdeep commented Dec 18, 2015

Getting the following errors when trying to authenticate. In the GA API manager, I set it up as Client ID for Other but I cannot even make it to the token page as I get the below error after inputting my Client ID and Secret.

File "/usr/local/bin/googleanalytics", line 6, in <module>
    cli()
  File "/Library/Python/2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 933, in invoke
    Command.invoke(self, ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/googleanalytics/commands/common.py", line 23, in cli
    save=True)
  File "/Library/Python/2.7/site-packages/googleanalytics/auth/__init__.py", line 95, in authenticate
    accounts = oauth.authenticate(credentials)
  File "/Library/Python/2.7/site-packages/googleanalytics/auth/credentials.py", line 216, in normalized_fn
    return fn(credentials)
  File "/Library/Python/2.7/site-packages/googleanalytics/auth/oauth.py", line 44, in authenticate
    raw_accounts = service.management().accounts().list().execute()['items']
  File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 140, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/googleapiclient/http.py", line 722, in execute
    body=self.body, headers=self.headers)
  File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 607, in new_request
    self._refresh(request_orig)
  File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 842, in _refresh
    self._do_refresh_request(http_request)
  File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 869, in _do_refresh_request
    body = self._generate_refresh_request_body()
  File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 807, in _generate_refresh_request_body
    body = urllib.parse.urlencode({
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlencode'
@debrouwere
Copy link
Owner

Hmm, maybe try downloading the very latest https://github.com/google/oauth2client. This isn't the first time Google has had trouble making their libraries fully Python2/3 compatible.

It would also be interesting to see if you have this same problem on Python 3 – I know you might not be able to use Python 3 for your project, but it would clarify whether it is indeed a compatibility problem (which is what it looks like) or something else.

@digdeep
Copy link
Author

digdeep commented Dec 23, 2015

Thanks. Will give it a go and provide update.

@digdeep
Copy link
Author

digdeep commented Jan 4, 2016

New Year, finally got around to testing this. I ran into the same issue with python 3 as with 2.7.

The error I get specifically, Error: no such option: --identity

It goes into the authentication screen in the browser, where it reads auth complete, but in the Command line it fails. I am assuming it has something to do with the token. Worth mentioning, using the same credentials with the Google google-api-python-client it works just fine with authentication.

I am on Mac OS X running El Capitan and using Conda so have diff py versions running on separate .env.

@debrouwere
Copy link
Owner

What is the exact command you're running on the command line?

@digdeep
Copy link
Author

digdeep commented Jan 4, 2016

googleanalytics authorize --identity myproject

It starts the authentication with Command Line line - human readable *.. but fails at the end when it tries authenticating in the browser.

@debrouwere
Copy link
Owner

Thanks, I'll dig into it.

@debrouwere debrouwere added the bug label Feb 12, 2016
@jj-dominguez
Copy link

jj-dominguez commented Sep 26, 2017

Is there any news on this? I've run into the same issue, getting Error: no such option: --identity running the googleanalytics authorize --identity myproject command on the command line. Any help appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants