How to run a downloaded Jupyter notebook on Google Colaboratory?

23,658

Solution 1

There is not a real need of downloading the notebook. If you already have your Notebook in a GitHub repo, the only thing you need to do is:

And that should work.

Solution 2

You can upload the notebook to google drive first, then open it from there.

  • go to drive.google.com
  • go into directory “Colab Notebooks”
  • choose “New” > File upload
  • After uploading, click the new file
  • Chose “Open with Colaboratory” at the top

Solution 3

The two most practical ways are both through the Google Drive webinterface.

The first method is what @Korakot Choavavanich described. The advantage of this method is that it provides a Search window to search for your file in your google drive storage.

The second method is even more convenient - and maybe more appropriate for your case:

In the Google Drive webinterface, you navigate to your folder where your file is located - in your case within the cloned github repository.

Then (see screenshot):

right-click on the file | Open with | Colaboratory

Your file is then converted into a colabo notebook automatically (it takes at least half a minute for that). The advantage with this method is that you can create the colabo file directly in the folder. My tip is to create a copy of the original jupyter file (I added "COLABO" in the file name) as you will have different code to sync your google drive and save files than in a local jupyter notebook.

enter image description here

Share:
23,658

Related videos on Youtube

Parthapratim Neog
Author by

Parthapratim Neog

A problem solver.

Updated on February 19, 2020

Comments

  • Parthapratim Neog
    Parthapratim Neog about 4 years

    I am using Google Colaboratory & github. I create a new Google Colab notebook, and I clone my github project into it using a simple !git clone <github_link> in the notebook.

    Now, I have a Jupyter notebook in my github project that I need to run on Google Colab. How do I do that?

    • Aptha Gowda
      Aptha Gowda over 5 years
      I want to do the same, I thought of running the !Jupyter notebook command inside my already existing colab notebook so that I can run the downloaded Jupyter notebook from Github repo. But its starting in localhost and I don't know how to get IP to run that in my browser.
  • Parthapratim Neog
    Parthapratim Neog about 6 years
    I know that, but I cannot do that. I have to download it from within the first notebook, and then open it. Since this is a git clone, the data pulled from git is not there in my drive, and as such I cannot open it from Google Colab
  • Orco
    Orco almost 4 years
    Nice thing is that when choosing the above, it will load all other notebooks existing in that repo.