0

我使用此代码连接到我的 Google 云端硬盘

!pip install -U -q PyDrive

from google.colab import files
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)

我删除了该adc.json文件,当我再次运行代码块时,它要求我再次进行身份验证,并使用不同的 Google Drive 用户。但是,当我上传文件时,它仍在上传到旧的谷歌驱动器。

我什至尝试过 pip 卸载并重新安装 pydrive,再次对新用户进行身份验证,上传文件,它仍然会上传到旧的谷歌驱动器。

我想知道为什么会这样?由于删除了 adc.json 文件并重置了运行时,因此应该没有任何东西连接到旧凭据。也许某种错误?

4

0 回答 0