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")