-
Notifications
You must be signed in to change notification settings - Fork 899
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 credentials.json not found for read #211
Comments
I had the same error but found I was just not reading carefully enough; based on your repro steps it's possible you ran into the same thing. The README.md is a bit confusing about this, but you need to follow the Prerequisites in the Python Quickstart page first: https://developers.google.com/gmail/api/quickstart/python#prerequisites Note the following requirements in particular:
|
I had the same issue, and it's kind of silly (just had to read carefully). Create a credential for your desktop application (as it's based on Python) as described by Nadersi: https://developers.google.com/workspace/guides/create-credentials Then, download the client secret JSON file: https://developers.google.com/workspace/guides/create-credentials#desktop Note, when it says:
This is the file they are referring as "credentials.json". Copy this client secret file to your proper location, rename it to "credentials.json" and of course, give it the read permissions. |
For anyone else having this issue who did follow the instructions to a T (except for one part)... My issue was that I was trying to run quickstart.py from within VS Code (with venv active). Why can't this work? Hell if I know. But when ran the file in terminal --> For the record, I did not have to change any permissions on the json file. It came with read permissions. |
Expected Behavior
As described in https://developers.google.com/gmail/api/quickstart/python
Actual Behavior
File "/hd2/projects/temp/python-samples/gmail/quickstart/quickstart.py", line 62, in
main()
File "/hd2/projects/temp/python-samples/gmail/quickstart/quickstart.py", line 41, in main
flow = InstalledAppFlow.from_client_secrets_file(
File "/home/stephen/.local/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 180, in from_client_secrets_file
with open(client_secrets_file, 'r') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'
Steps to Reproduce the Problem
1.Download these python samples
Specifications
python --version
)The text was updated successfully, but these errors were encountered: