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

未关闭
#1,278 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@sqrrrl 已经在做这个了。

开始于 2024年2月3日。

评估

这个 Issue 还没有评估数据。

描述

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. 

主要语言
Python
星标
1.4k
派生
917
平均合并
3 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

googleworkspace/python-samples 的其他 Issue

查看 googleworkspace/python-samples 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。