Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#298 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, cloud

Hướng nghiên cứu

Issue không nêu tên tệp repository, test hay entry point nào. Trước tiên, hãy tái hiện lỗi truyền thông tin xác thực trong Google Colab đồng thời so sánh việc thiết lập pydrive và pydrive2; được xem là hoàn thành khi xác định được liệu lỗi có phải do PyDrive2 gây ra hay không và ghi lại một cách khởi tạo hoạt động được hoặc một phương án thay thế đơn giản.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Python
Star
668
Fork
75
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của iterative/PyDrive2

Tất cả issue của iterative/PyDrive2

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.