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

DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials #1278

Open
mannaaaz opened this issue Feb 3, 2024 · 1 comment
Assignees

Comments

@mannaaaz
Copy link

mannaaaz commented Feb 3, 2024

Summary

I went through all these steps here: [https://developers.google.com/drive/api/quickstart/python#authorize_credentials_for_a_desktop_application] and downloaded, renamed the credentials.json. The reason why I am doing this because I want to load some of my google drive folders into LangChain to build a chatbot. Anyways, when i write this code:


loader = GoogleDriveLoader(
    folder_id="1JPOaEJdy-LiiqBAZpRQ4FH0ssSFuy7i3",
    #token_path="/Users/mannaz/Desktop/PsychedelicTest/psychedelicProject/google_token.json",
    # Optional: configure whether to recursively fetch files from subfolders. Defaults to False.
    recursive=False,
)
#%%
docs = loader.load()

` ` `  
I get an error: 

DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

What could be the reasons? I followed the steps exactly. And before that I was getting the error: quickstart.py fails on error: No such file or directory: 'credentials.json'  and now this. 

@mannaaaz
Copy link
Author

mannaaaz commented Feb 3, 2024

when i added this cell before:

import os os.environ["GOOGLE_APPLICATION_CREDENTIALS"] ="/Users/mannaz/Desktop/PsychedelicTest/psychedelicProject/credentials.json"

it gives me this error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/mannaz/.credentials/credentials.json'

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