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

'Error opening file', 'credentials.json' #25

Closed
poirier opened this issue Jul 28, 2018 · 2 comments
Closed

'Error opening file', 'credentials.json' #25

poirier opened this issue Jul 28, 2018 · 2 comments
Assignees

Comments

@poirier
Copy link

poirier commented Jul 28, 2018

Running the quickstart sample for the first time, from the instructions I expected it to open a browser window for me to authenticate myself. Instead I got the following tracebacks:


$ python sheets.py
/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
  File "/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 121, in _loadfile
    with open(filename, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "sheets.py", line 14, in <module>
    flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
  File "/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/client.py", line 2135, in flow_from_clientsecrets
    cache=cache)
  File "/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
    return _loadfile(filename)
  File "/home/poirier/.virtualenvs/pdfextract/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 125, in _loadfile
    exc.strerror, exc.errno)
oauth2client.clientsecrets.InvalidClientSecretsError: ('Error opening file', 'credentials.json', 'No such file or directory', 2)
@erickoledadevrel
Copy link

The error indicates that it can't find the credentials.json file downloaded in Step 1. Can you ensure it's in the same directory?

@erickoledadevrel erickoledadevrel self-assigned this Jul 30, 2018
@poirier
Copy link
Author

poirier commented Jul 30, 2018

I missed step 1c in the instructions.

@poirier poirier closed this as completed Jul 30, 2018
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