I know that I can access my google drive files from colab with a code like this:
from google.colab import drive
drive.mount('/content/drive')
But in this way, only me is able to access data file located on my drive. If I share my colab notebook with someone, how can he/she access to that file? Obviously above code is not applicable for him/her, because he does can't access my account to authorize colab.
Simply click the Share button at the top right of any Colab notebook, or follow these Google Drive file sharing instructions. If you choose to share a notebook, the full contents of your notebook (text, code, output, and comments) will be shared.
Collaboration. Another great feature that Google Colab offers is the collaboration feature. If you are working with multiple developers on a project, it is great to use Google Colab notebook. Just like collaborating on a Google Docs document, you can co-code with multiple developers using a Google Colab notebook.
Scroll down to Open files from Google Drive and click on INSERT. Go to the URL link on your browser to grant access to Colab, copy the authorization code and paste it into the space given in the notebook. You can now access all your datasets on your Drive directly on Colab. Then, you can proceed to work with it.
There are 2 ways.
You share the folder with him. He click the folder and choose "Add to My Drive". It will create a symlink (it won't copy, won't take space). He can now mount it the same way as you, using drive.mount(..)
.
Share the folder with him. Then access the folder and files within using pydrive, not drive.mount(). You must use the FILE_ID instead of file names to refer to those folder and files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With