Colaboratory: How to install and use on local machine?
Asked Answered
B

3

29

Google Colab is awesome to work with, but I wish I can run Colab Notebooks completely locally and offline, just like Jupyter notebooks served from the local?

How do I do this? Is there a Colab package which I can install?


EDIT: Some previous answers to the question seem to give methods to access Colab hosted by Google. But that's not what I'm looking for.

My question is how do I pip install colab so I can run it locally like jupyter after pip install jupyter. Colab package doesn't seem to exist, so if I want it, what do I do to install it from the source?

Biak answered 5/5, 2018 at 22:40 Comment(3)
Probably JupyterLonnalonnard
I just don't wanna re-invent the wheel forking jupyter, adding buttons to create form elements values of which will be used as variables in python code, and adding those "add code/add text" buttons at the bottom of every cell which are super usefulBiak
That's why people should make their open source projects AGPL :-)Raisin
B
19

From this Github link, it seems that Google Colab may not be (or remain) opensource.

From whatever I have hunted for, the repo is here:

git clone https://github.com/googlecolab/colabtools.git
cd colabtools
python setup.py install

And then check if you have it installed :)

pip list | grep colab
google-colab                       0.0.1a1

Alternatively if you want a wheel (will be put inside dist folder), you shall do

python setup.py bdist_wheel
Biak answered 13/6, 2018 at 16:43 Comment(7)
pip list | grep colab returns google-colab 0.0.1a1. But from google.colab import drive still gives ImportError: No module named 'google.colab' error.Maricamarice
Yeah, same here: I installed google-colab 1.0.0 through that git clone, but python -c "import google.colab" complains there isn't such a module...Frisco
@Saravanabalagi how do you launch Colab once it's installed locally?Nonobedience
FWIW You can make it work without explicitly cloning it yourself: pip install git+https://github.com/googlecolab/colabtools.git See here: pip.pypa.io/en/stable/reference/pip_install/#vcs-supportTorbart
Posted issue here, dunno if they may respond: github.com/googlecolab/colabtools/issues/1415Torbart
Merp. Got closed in about 30sec :PTorbart
google.colab was not able to mount locally. drive.mount fails with KeyError: 'TBE_EPHEM_CREDS_ADDR'. This can be set as an environment variable, but will that work?Cleancut
H
-4

Google Colab is a cloud computer,it only runs through Internet,you can design your Python script,and run the Python script through Colab,run Python will use Google Colab hardware,Google will allocate CPU, RAM, GPU and etc for your Python script,your local computer just submit Python code to Google Colab,and run,then Google Colab return the result to your local computer,cloud computation is stronger than local
computation if your local computer hardware is limited,see this question link will inspire you,asked by me,https://mcmap.net/q/502721/-how-to-apply-googlecolab-stronger-cpu-and-more-ram-closed/48922199#48922199

Hui answered 5/5, 2018 at 23:10 Comment(7)
completely agree with the advantages of cloud platform. but for smaller tasks, it restricts more, for eg., if it was running locally, i can modify it to use Ctrl+D shortcut to select and edit multiple things at once. (That's just an example though and one may want to tweak it to their needs)Biak
use PythonIDLE。。。。Libb
We are stuck to what Google provides if we use GoogleColab, aren't we?Biak
IDE is not key,IDLE Pycharm Visual Studio are all good,even if Windows notepad,you can use any kind of IDE as you likeLibb
You mean to say "use Jupyter locally with your favourite ide and then upload to cloud for processing"?Biak
sounds intrestingLibb
Please delete your answer. It does not at all address the question. It is arguing to the OP to be inspired to use Google Cloud. In fact the OP is asking how to NOT use Collaboratory on Google Cloud.Ultra
S
-4

Yes, you can connect Google Colab to Jupyter running on your local machine.

Colaboratory Local runtimes

Follow the instructions in the link above. You just need to install the jupyter extension jupyter_http_over_ws.

Scraperboard answered 28/5, 2018 at 9:51 Comment(4)
Hey, thanks for your answer. But that's for setting up websocket between my laptop (to act as server) and colab's server and displaying things in the colab website (colab acts as client). But I need to work offline i.e., run both server and client in my machine.Biak
If you just want something more fancy than the current jupyter notebook, you may consider trying jupyterlab -- the next generation of jupyter github.com/jupyterlab/jupyterlabScraperboard
Doesn't answer the question as posed.Haftarah
I down-voted your answer, because your answer is the opposite of what the original post is asking for, i.e., he/she wants to run Collaboratory LOCALLY. Delete your answer and I will delete my downvote.Ultra

© 2022 - 2024 — McMap. All rights reserved.