How to run a downloaded Jupyter notebook on Google Colaboratory?
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:
- 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.
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.
Related videos on Youtube
Comments
-
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 over 5 yearsI 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 about 6 yearsI 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 almost 4 yearsNice thing is that when choosing the above, it will load all other notebooks existing in that repo.