quickstart.py credentials.json not found for read

オープン
#211 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

The failure comes from the InstalledAppFlow.from_client_secrets_file call in main() of gmail/quickstart/quickstart.py, which opens credentials.json relative to the current working directory. Reproduce by running the script from a different directory than the one holding the file, then decide whether the sample should resolve the path against the script's location or report a clearer error. Done means the script either finds the credentials file or fails with an actionable message, and the README or quickstart text says where the file must go.

索引モデルが issue の本文から書いたものです。

説明

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

  1. install requirements through requirements.txt
  2. run the script

Specifications

  • Python version (python --version)
  • 3.9.6
  • OS (Mac/Linux/Windows)
  • Arch rolling[5.10.48-1-lts]
主要言語
Python
スター
1.4k
フォーク
917
平均マージ
3分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/python-samples のほかの issue

googleworkspace/python-samples の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。