googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.21k stars 728 forks source link

Install colab for offline use? #1374

Closed MyFakeHub closed 4 years ago

MyFakeHub commented 4 years ago

I would love it if I could download and install a colab package that lets me run local notebooks like jupyter.

Is there a way to do that? Is there a package I can install like pip install colab and then I could run colab notebook from terminal to run locally and offline my python notebooks?

craigcitro commented 4 years ago

There's no way to run the colab frontend locally.

If you'd like to use the colab frontend with a local runtime, see: https://research.google.com/colaboratory/local-runtimes.html

lnryan commented 2 years ago

Hello,

The only thing our team really needs from the collab libraries is the auth module as we want to preserve the individual login/token interaction and have this be specific to the individual's access rights (ie rather than binding to a service user).

Is there an alternative google library that provides the same functionality?

Note: I can respect that the collab team wants to encourage use of their in-the-cloud product; however we found it did not work well for our team within a large organization because the repo selection interface is buggy and assumes a separate repo for notebooks rather than notebooks within a related mono repo.

jwvanderbeck commented 2 years ago

So then how are we supposed to enable third party widgets when running locally if we can't run the colab module locally?

#@title Enable third party widgets
from google.colab import output
output.enable_custom_widget_manager()

I need to be able to run that but can't because I can't install colab package?

100rab-S commented 1 year ago

@jwvanderbeck Exactly! In my case, I'm trying to use tqdm in notebook mode, which btw works fine with Jupyter Notebooks. from tqdm.notebook import tqdm

But the notebook mode of tqdm does not work on the local colab connection. For that, I need to run

from google.colab import output
output.enable_custom_widget_manager()

Since the google package here is not available locally. I'm unable to...

@craigcitro What do we do here?

sebbov commented 1 year ago

If you can use Docker, try the Colab Docker runtime image option at https://research.google.com/colaboratory/local-runtimes.html. As explained there, the resulting runtime will include packages found in our hosted environment.

100rab-S commented 1 year ago

Thanks for the quick reply @sebbov I tried the Colab Docker Runtime Image option. But it completely fails the motivation for local setup in the present stage.

  1. I can't serve notebook from a particular directory.
  2. I cannot use local packages and files.
  3. etc etc

So no, I cannot use this approach. I use Colab as an alternative for Jupyter Notebook due to its design and handy keyboard shortcuts. Is there any other way I can solve the before mentioned problem? Also why is the colab package not available as an open-source? It has some great UI features and resource utilization monitor. It would have been great if it can do the same in a local setup 🤩.

@sebbov I am willing to invest time to make it work if there is a way to bring the hosted features into a local setup. Please inform me if there is any possibility in this direction.

sebbov commented 1 year ago

There are no plans of open sourcing the colab package, or offering hosted features in the local setup besides Docker in general. In case you give it another look, Docker has options that may help with the limitations you perceived. You can for instance map files from the host to the container, install packages in the runtime and keep those around across reboots, extend the image using your own Dockerfile, etc. Nothing Colab specific -- Docker tutorials should be helpful. It is a larger effort than just being able to install colab in your situation, unfortunately.

100rab-S commented 1 year ago

@sebbov Thanks for clarification. Okay I'll look into it and see if I can make it work as required.