m.farokhian
m.farokhian

Reputation: 159

Share files with other collaborators in google colab

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.

Upvotes: 11

Views: 15473

Answers (2)

korakot
korakot

Reputation: 40838

There are 2 ways.

  1. 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(..).

  2. 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.

Upvotes: 8

pacific_sherlock
pacific_sherlock

Reputation: 39

What you want to do is to share permissions of shared folders, in this case other users can edit, comment. or view shared folders, for that:

  1. Go to drive.google.com

  2. Select the folder that you want to change owners.

  3. Click share at the top right
  4. Click Advanced
  5. To the right of the person's name Click Is Owner, and then save changes

Upvotes: 1

Related Questions