Skip to content Skip to sidebar Skip to footer

Google Api: Why Can't It Find My File?

So I am trying to use the Google Drive API, but I keep running into an error (Cannot access credentials.json: No such file or directory). I looked up what someone else did and the

Solution 1:

You have to create an empty configuration.json file. Github Google Issue.

Please follow the following setup steps to get the authentication properly.

Step 1: Turn on the Drive API

  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.

  2. On the Add credentials to your project page, click the Cancel button.

  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.

  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.

  5. Select the application type Other, enter the name "Drive API Quickstart", and click the Create button.

  6. Click OK to dismiss the resulting dialog.

  7. Click the file_download (Download JSON) button to the right of the client ID.

  8. Move this file to your working directory and rename it client_secret.json.

Documentation: https://developers.google.com/drive/v3/web/quickstart/python

UPDATE

Apparently, there is a conflict between argparse and Jupyter [Reference]

and oauth2client is using argparse Github Code Link

I have not used Jupyter myself, but if you can, try using your google drive api code independently without Jupyter.

Solution 2:

just copy your credential file and paste in the same folder in the c drive.

Post a Comment for "Google Api: Why Can't It Find My File?"