Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google colaboratory run code locally

Is it possible to run Google Colaboratory scripts in my computer locally? If not, why it has been designed in that way?

I would like to work collaboratively in short code scripts without having to use version control systems such as Github and being able to do so using Windows OS, in a simple way like sending a link for the code in some platform like Google Drive.

For the moment I have not been able to do this using Jupyter Notebook, because it seems that, at least for now, it would be necesary to work in a Unix-like Operative System. Another possiblity I have found (but not been able to perform) is using the nbviewer webservice. The instructions to set it up are a bit complicated or need special requirements such as having Windows Pro or Enterprise editions.

I found the Google Colaboratory tool that allows me to do this but there are some libraries that I am not able to import/use on it (gurobipy). Also there is the issue that some of these libraries connect to software that need some licenses in order to be used (I use them with the license of my university).

I would like to know if there is a way to run the code locally (without having to download the script each time) or another tool to achieve this.

Here are some related questions:

https://github.com/googlecolab/colabtools/issues/29

How to directly upload a Jupyter notebook from Local Machine onto Google Collab? Is there a way to do this?

Google Colab is very slow compared to my PC

wish to use colaboratory. What is simplest way to do a get drive file to python (encapsulated)?

Please let me know if I have misunderstood something in my research or have missed some option to do this things. Thanks in advance!

like image 257
Gonzalo Avatar asked Mar 24 '18 16:03

Gonzalo


People also ask

Does Google colab run locally or cloud?

Since a Colab notebook is hosted on Google's cloud servers, there's no direct access to files on your local drive (unlike a notebook hosted on your machine) or any other environment by default. However, Colab provides various options to connect to almost any data source you can imagine.

Can I run code on Google Colab?

The Basics. Colaboratory, or “Colab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education.

How do I run code from Google colab on Google drive?

To run the code in any cell, you can click the run button on the left side of the code cell (looks like a “play” button with a triangle in a circle) or you can click [shift] + [enter]. The output will appear right below the code cell. You can import many popular libraries without having to install them first.


1 Answers

You can use Colab with a local Jupyter backend, thereby providing easy access to local files and a persistent environment, but still being able to share notebooks using Drive.

Instructions for using local Jupyter with Colab are here: https://research.google.com/colaboratory/local-runtimes.html

like image 123
Bob Smith Avatar answered Oct 11 '22 18:10

Bob Smith