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

Quickstart.py may need a current directory declaration #16

Open
pumodi opened this issue Mar 5, 2022 · 1 comment
Open

Quickstart.py may need a current directory declaration #16

pumodi opened this issue Mar 5, 2022 · 1 comment

Comments

@pumodi
Copy link

pumodi commented Mar 5, 2022

Hey @speedyg0nz. Just wanted to let you know of an error I ran into and the method I used to fix it. For some reason running the quickstart.py as is returned an error.

Adding this to line 22
CURR_DIR = os.path.dirname(os.path.realpath(__file__))

and changing line 39-41 from this:
flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server(port=0)

to this:
credential_file=str(CURR_DIR)+'/credentials.json' flow = InstalledAppFlow.from_client_secrets_file( credential_file, SCOPES) creds = flow.run_local_server(port=0)

That fixed the issue for me. Unfortunately, I'm having trouble replicating it now so I can't specify what the error it threw actually was. Apologies there. Starting from a fresh repo in a new environment doesn't have the issue at all. This is probably an edge case.
I think this is an environment thing but thought it worth sharing regardless in case anyone else encounters it in the future.

@kfprugger
Copy link

Confirmed.

Added/augmented the marked lines 25 & 39. After changing, the code now works.

image

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