0

I have a python script that I'm trying to push excel files to google sheets. The code I made works great when running from the source code, but when I try to run it from a compiled exe file it fail when trying to authenticate.

It sometimes fails at the initial line of code and others the final line. I've tried removing the credentials file. Adding settings.yaml as suggested here https://github.com/iterative/PyDrive2/issues/92.

Nothing seems to work. Ideas are welcomed.

gauth = GoogleAuth()
# Try to load saved client credentials
gauth.LoadCredentialsFile("mycreds.txt")
if gauth.credentials is None:
    # Authenticate if they're not there
    gauth.LocalWebserverAuth()
elif gauth.access_token_expired:
    # Refresh them if expired
    gauth.Refresh()
else:
    # Initialize the saved creds
    gauth.Authorize()
# Save the current credentials to a file
gauth.SaveCredentialsFile("mycreds.txt")
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 21 '22 at 02:27
  • I'm trying to figure out why the code runs perfectly when I run it in pycharm, but it always fails authentication when ran via executable file. – ryan rogers Oct 21 '22 at 17:57

0 Answers0