I would like to not only import several python modules/files into Google Colab, but an entire directory (which might itself have sub-directories).
-
What did you try, and what error did you encounter? Can you share a self-contained notebook that reproduces the problem you observe?Bob Smith– Bob Smith2019-03-15 23:47:57 +00:00Commented Mar 15, 2019 at 23:47
-
@BobSmith Using the Upload feature on the File tab, it seems to me I can only upload files, not directories.Stephane Bersier– Stephane Bersier2019-03-15 23:56:03 +00:00Commented Mar 15, 2019 at 23:56
Add a comment
|
1 Answer
The simplest mechanism to synchronize a directory is to use the Drive FUSE client
To mount your Drive files on the Colab backend, run:
from google.colab import drive
drive.mount('/content/gdrive')
Then, you can upload files to drive.google.com, or use Backup and Sync on your desktop to sync directories efficiently.
1 Comment
Stephane Bersier
Thanks Bob. How would I import specific modules from Drive after mounting it? The first link you provide only talks about reading from and writing to files from Drive.