0

I have a number of directories of Python programs what I would like to execute on Colaboratory. Is there a way to do that -- other than to load and save the files one-by-one? If it helps, the directories are all in my own Google Drive. So all I would need (I think) is a way to cd to a given directory. I tried !cd .., which presumably should go to my top Google Drive directory, but it doesn't seem to work.

Just copied a directory into Google Drive\Colab Notebooks using the file explorer. But Colab refused to cd to that directory.

RussAbbott
  • 2,660
  • 4
  • 24
  • 37

2 Answers2

0

You'll need to mount your Google Drive before files contained therein will be available in Colab.

A recipe for how to mount Drive is available in this answer: https://stackoverflow.com/a/47744465/8841057

Bob Smith
  • 36,107
  • 11
  • 98
  • 91
0

After you mount the drive, don’t use !cd.

Use %cd instead.

korakot
  • 37,818
  • 16
  • 123
  • 144