Colab - automatic authentication of connection to google drive

喜你入骨 提交于 2020-02-12 12:28:35

问题


I'm looking for a way to automate the authentication process when connecting a colab-session to my google drive.

I'd prefer to use the built-in tools for this one, instead of PyDrive.

In short: have the following cell run without having to manually authenticate by logging in and copying the password from the dialogue

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

回答1:


Automatically mounting to your Drive files is now supported for Colab notebooks which aren't shared by multiple people.

To enable this for a notebook, create a new Drive notebook, open the file browser, and click the 'Mount Drive' button.

You'll see a permissions dialog like so:

After you complete the permissions once, you'll see your Drive mounted in the file browser.

Better still, if you reload the notebook later and reconnect, your Drive will mount automatically with no more drive.mount copy/paste required. Your Drive files will just be there.



来源:https://stackoverflow.com/questions/52808143/colab-automatic-authentication-of-connection-to-google-drive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!