Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A simple way of initializing a pydrive.GoogleDrive object fails when pydrive is replaced by pydrive2

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api, cloud

調査の方向性

issue では、リポジトリのファイル、テスト、エントリーポイントのいずれも指定されていません。まず、pydrive と pydrive2 のセットアップを比較しながら、Google Colab で credential-propagation error を再現してください。PyDrive2 が失敗の原因かどうかを特定し、動作する初期化または単純な代替手段を文書化できれば完了です。

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

説明

duplicate question

The following code works when executed in Google Colab. The code is, in fact, copied from one of the official Google Colab tutorials, the one titled External data: Local Files, Drive, Sheets, and Cloud Storage.

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials

auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)

However, when pydrive is replaced by pydrive2 in the above listing, and the code is executed in Google Colab, the following error messages result:

---------------------------------------------------------------------------
MessageError                              Traceback (most recent call last)
[<ipython-input-4-3254a9bed9fd>](https://localhost:8080/#) in <cell line: 1>()
----> 1 auth.authenticate_user()
      2 gauth = GoogleAuth()
      3 gauth.credentials = GoogleCredentials.get_application_default()
      4 drive = GoogleDrive(gauth)

2 frames
[/usr/local/lib/python3.10/dist-packages/google/colab/_message.py](https://localhost:8080/#) in read_reply_from_input(message_id, timeout_sec)
    101     ):
    102       if 'error' in reply:
--> 103         raise MessageError(reply['error'])
    104       return reply.get('data', None)
    105 

MessageError: Error: credential propagation was unsuccessful

Why doesn't the code work with pydrive2? Can pydrive2 be made to work with this code? If not, is there a simple alternative?

主要言語
Python
スター
670
フォーク
75
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

iterative/PyDrive2 のほかの issue

iterative/PyDrive2 の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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