Reputation: 985
Lately when using pydrive from Google Collab like this
!pip install -U -q PyDrive
import os
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
# 1. Authenticate and create the PyDrive client.
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)
I enter the code and all but after that i started getting ApiRequestError when trying to create file. In the response i see Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.
How do you fix that?
Upvotes: 2
Views: 1081
Reputation: 38619
For PyDrive, you'll need to create and use a distinct OAuth client client ID with higher limits. Instructions are here:
https://pythonhosted.org/PyDrive/quickstart.html#authentication
But, it's probably simpler to use the built-in Drive FUSE client to interact with Drive. To use that, execute a code cell with the following snippet:
from google.colab import drive
drive.mount('/content/drive')
Upvotes: 1