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

Getting authentication issues after Auth Flow Browser Popup #18

Closed
schwallie2 opened this issue Sep 20, 2016 · 5 comments
Closed

Getting authentication issues after Auth Flow Browser Popup #18

schwallie2 opened this issue Sep 20, 2016 · 5 comments

Comments

@schwallie2
Copy link

schwallie2 commented Sep 20, 2016

If your browser is on a different machine then exit and re-run this
application with the command-line parameter

  --noauth_local_webserver

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-265-3278267de75b> in <module>()
----> 1 d2g.upload(df, 'OTAT Donor Database', 'New2')

/Users/xxxx/anaconda/lib/python2.7/site-packages/df2gspread/df2gspread.pyc in upload(df, gfile, wks_name, chunk_size, col_names, row_names, clean, credentials, start_cell, df_size, new_sheet_dimensions)
     74     '''
     75     # access credentials
---> 76     credentials = get_credentials(credentials)
     77     # auth for gspread
     78     gc = gspread.authorize(credentials)

/Users/xxxx/anaconda/lib/python2.7/site-packages/df2gspread/utils.pyc in get_credentials(credentials, client_secret_file, refresh_token)
     78         flow.redirect_uri = client.OOB_CALLBACK_URN
     79         if flags:
---> 80             credentials = tools.run_flow(flow, store, flags)
     81         else:  # Needed only for compatability with Python 2.6
     82             credentials = tools.run(flow, store)

/Users/xxxx/anaconda/lib/python2.7/site-packages/oauth2client/util.pyc in positional_wrapper(*args, **kwargs)
    133                 elif positional_parameters_enforcement == POSITIONAL_WARNING:
    134                     logger.warning(message)
--> 135             return wrapped(*args, **kwargs)
    136         return positional_wrapper
    137

/Users/xxxxx/anaconda/lib/python2.7/site-packages/oauth2client/tools.pyc in run_flow(flow, storage, flags, http)
    237         sys.exit('Authentication has failed: %s' % e)
    238
--> 239     storage.put(credential)
    240     credential.set_store(storage)
    241     print('Authentication successful.')

/Users/xxxxx/anaconda/lib/python2.7/site-packages/oauth2client/client.pyc in put(self, credentials)
    432         self.acquire_lock()
    433         try:
--> 434             self.locked_put(credentials)
    435         finally:
    436             self.release_lock()

/Users/xxxxx/anaconda/lib/python2.7/site-packages/oauth2client/file.pyc in locked_put(self, credentials)
     93             CredentialsFileSymbolicLinkError if the file is a symbolic link.
     94         """
---> 95         self._create_file_if_needed()
     96         self._validate_file()
     97         f = open(self._filename, 'w')

/Users/xxxxxx/anaconda/lib/python2.7/site-packages/oauth2client/file.pyc in _create_file_if_needed(self)
     80             old_umask = os.umask(0o177)
     81             try:
---> 82                 open(self._filename, 'a+b').close()
     83             finally:
     84                 os.umask(old_umask)

IOError: [Errno 2] No such file or directory: '/Users/xxxxx/.oauth/drive.json'`

Getting the above error after I complete the Browser authentication piece (So I get through the auth stuff, it uses gdrive_private, etc)

@maybelinot
Copy link
Owner

maybelinot commented Sep 21, 2016

@schwallie2 Have you tried to create '/Users/xxxxx/.oauth/drive.json' file manually?
I haven't tested this library on Windows, and obviously on anaconda, so there could be some collisions..
In general this file('/Users/xxxxx/.oauth/drive.json') should be created after authentication workflow from your gdrive_private file, if you didn't see it then something went wrong. I will try to look more deeply ASAP.

@schwallie2
Copy link
Author

Just FYI this is on a Mac.

Created the file and it worked fine. Very weird.

@maybelinot
Copy link
Owner

@schwallie2 sure anaconda is multiplatform.. Just get used to use it on windows earlier..
I think the problem is in creation of drive.json file in non-existing .oauth folder, will try to fix in near future

@schwallie2
Copy link
Author

schwallie2 commented Sep 21, 2016

Agreed that is probably it

@schwallie2 schwallie2 reopened this Sep 21, 2016
@maybelinot
Copy link
Owner

@schwallie2 Can you check if the issue still present, please?

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

No branches or pull requests

2 participants