Python Colaboratory:如何在本地机器上安装和使用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50194637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 19:25:04  来源:igfitidea点击:

Colaboratory: How to install and use on local machine?

pythonpipgoogle-colaboratory

提问by Saravanabalagi Ramachandran

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?

使用 Google Colab 很棒,但我希望我可以完全在本地和离线运行 colab 笔记本,就像从本地提供的 jupyter 笔记本一样?

How do I do this? Is there a colabpackage which I can install?

我该怎么做呢?有colab我可以安装的软件包吗?



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.

编辑:该问题的一些先前答案似乎提供了访问由 Google 托管的 Colab 的方法。但这不是我要找的。

My question is how do I pip install colabso 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?

我的问题是我如何才能pip install colab像 jupyter 一样在本地运行它pip install jupyter。Colab 包似乎不存在,所以如果我想要它,我该怎么做才能从源代码安装它?

采纳答案by Saravanabalagi Ramachandran

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

从这个Github 链接看来,Google Colab 可能不是(或保持)开源。

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

或者,如果你想要一个轮子(将放在 dist 文件夹中),你应该这样做

python setup.py bdist_wheel

回答by Po C.

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

是的,您可以将 Google Colab 连接到在本地机器上运行的 Jupyter。

Colaboratory Local runtimes

协作本地运行时

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

按照上面链接中的说明进行操作。您只需要安装 jupyter 扩展jupyter_http_over_ws

回答by u7420336

GoogleColab is a cloud computer,it only runs through Internet,you can desigh your PythonScript,and run PythonScript through Colab,run PythonScript will use GoogleColab hardware,Google will allocate CPU RAM GPU and etc for your PyScript,your lical computer just submit Python code to GoogleColab,and run,then GoogleColab return 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,How to apply GoogleColab stronger CPU and more RAM?

GoogleColab 是一台云电脑,它只通过互联网运行,你可以设计你的 PythonScript,并通过 Colab 运行 PythonScript,运行 PythonScript 将使用 GoogleColab 硬件,Google 会为你的 PyScript 分配 CPU RAM GPU 等,你的本地计算机只需提交 Python 代码到 GoogleColab,然后运行,然后 GoogleColab 将结果返回到您的本地计算机,
如果您的本地计算机硬件有限,云计算比本地计算强,请参阅此问题链接会对您有所启发,由我问,如何应用 GoogleColab 更强的 CPU 等等内存?