Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Google Colab中使用pydrive时发生ApiRequestError_Python_Google Colaboratory_Pydrive - Fatal编程技术网

Python 在Google Colab中使用pydrive时发生ApiRequestError

Python 在Google Colab中使用pydrive时发生ApiRequestError,python,google-colaboratory,pydrive,Python,Google Colaboratory,Pydrive,最近在使用Google Collab的pydrive时 !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 t

最近在使用Google Collab的pydrive时

!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)
我输入了代码,但在这之后,我开始在尝试创建文件时出错。在回复中,我看到未经验证的使用超过了
每日限额。继续使用需要注册。


如何解决此问题?

对于PyDrive,您需要创建并使用具有更高限制的独特OAuth客户端ID。说明如下:

但是,使用内置驱动器保险丝客户端与驱动器交互可能更简单。要使用它,请使用以下代码段执行代码单元:

from google.colab import drive
drive.mount('/content/drive')