I connected to my Google Drive using this code

!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

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

I deleted the adc.json file, and when I run the code block again, it asks me to authenticate again, and use a different Google Drive user. However, when I upload a file, it's still uploading to the old google drive.

I even tried pip uninstalling and reinstalling pydrive, authenticate to new user again, upload file, and it still uploads to the old google drive.

I am wondering why this happens? Since the adc.json file is deleted and the runtime is reset, there should be nothing connecting to the old credentials. Perhaps some sort of bug?

0 Answers