Stephane Bersier
Stephane Bersier

Reputation: 769

How to import a Python package into Google Colab?

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

Upvotes: 0

Views: 425

Answers (1)

Bob Smith
Bob Smith

Reputation: 38579

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.

Upvotes: 2

Related Questions