Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a downloaded Jupyter notebook on Google Colaboratory?

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?

like image 206
Parthapratim Neog Avatar asked Feb 24 '18 10:02

Parthapratim Neog


People also ask

How do I run a downloaded Jupyter notebook?

You can run the notebook document step-by-step (one cell a time) by pressing shift + enter. You can run the whole notebook in a single step by clicking on the menu Cell -> Run All. To restart the kernel (i.e. the computational engine), click on the menu Kernel -> Restart.

How do I run a Ipynb File in Google Colab?

ipynb' file extension. Open files by either doubling clicking on them and selecting Open with > Colaboratory from the button found at the top of the resulting page or by right clicking on a file and selecting Open with > Colaboratory from the file's context menu.


2 Answers

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:

  • Open your Notebook file on GitHub in any browser (So the URL ends in .ipynb).
  • Change the URL from https://github/full_path_to_your_notebook to https://colab.research.google.com/github/full_path_to_your_notebook

And that should work.

like image 101
Sebas Arango Avatar answered Oct 14 '22 13:10

Sebas Arango


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
like image 37
korakot Avatar answered Oct 14 '22 15:10

korakot