Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount a Google Shared Drive in Google Colaboratory?

I am working in Google Colaboratory. Until about a week ago, I was able to mount my shared drive using the following:

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

and then read a data file using:

data = pd.read_csv('/content/drive/Team Drives/TestProject/test.csv')

About a week ago, after they updated team drives to shared drives, that stopped working. How do I access my shared drive files now?

like image 822
Amanda Watson Avatar asked Oct 27 '22 11:10

Amanda Watson


1 Answers

All that needed to be done was update "Team Drives" to "Shared drives".

Changing the code to this works:

data = pd.read_csv('/content/drive/Shared drives/TestProject/test.csv')

like image 64
Amanda Watson Avatar answered Nov 09 '22 09:11

Amanda Watson