Search code examples
pythongoogle-colaboratory

how to open a jupyter notebook under a folder in google drive?


I am trying to open a existing jupyter notebook from a folder in google drive. In colab, I do:

File-> open notbook-> google drive

Only jupyter notebook files under colab Notebooks are shown, even I have a folder inside Colab Notebooks, that folder is not shown. How can I open the notebook inside a folder?

But if I do below code, I can see all the files under content/drive/MyDrive. But I can only see notebook as a text, see below screenshot for the opened notebook shown on the right hand side. how can I open it a jupyter notebook in colab so I can run the cells? Thanks


# Load the Drive helper and mount
from google.colab import drive
drive.mount('/content/drive')

enter image description here


Solution

  • I usually open these in Colab by right clicking directly in Google drive (not from within Colab itself) and selecting Open with --> Google Colaboratory.