accessing "Shared with me" with Colab accessing "Shared with me" with Colab python python

accessing "Shared with me" with Colab


Another work around is go to Google Drive, right click on the folder in question, and then click "Add shortcut to Drive". This will allow you to access the folder from your drive!


RE: Is there a work-around --

Load your shared files in the web UI, right click on the directory of interest, and select 'Add to my Drive'. Then, the folder will appear in /content/drive/My Drive as you hope.

For context, Drive isn't like a normal filesystem: files and directories can have multiple parents, thereby appearing in both your file list and the original owners.

RE: Will other users have access to Drive files? --

No, the notebook is a distinct object in Drive with distinct Drive permissions.


I solved by adding the main/top folder as shortcut to my drive, and then I used a code like yours

My case:

I wanted to load a csv file from a folder which was in a folder shared with me, so in my gdrive would be in "Shared with me/folder_0/folder_1/file.csv"

So I went to folder_0 right bottom click "Add shortcut to Drive" --> "My Drive" --> "ADD SHORTCUT". Now the whole folder_0 should be added to your drive as a shortcut.

Finally in the colab nb:

# Mount data from drivefrom google.colab import drivedrive.mount('/content/drive')pandas.read_csv("/content/drive/My Drive/folder_0/folder_1/file.csv")

In my case is a csv file loaded in pandas, but what matters here is the path "/content/drive/My Drive/folder_0/folder_1/file.csv", where "/content/drive/My Drive/" is always like this and "folder_0/folder_1/file.csv" is the part that must be equal to the shorcut path you just added