0

I would like to not only import several python modules/files into Google Colab, but an entire directory (which might itself have sub-directories).

2
  • What did you try, and what error did you encounter? Can you share a self-contained notebook that reproduces the problem you observe? Commented 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. Commented Mar 15, 2019 at 23:56

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.