简体   繁体   English

有没有办法在本地 Jupyter 笔记本中使用 Google Colab 表单功能?

[英]Is there a way to use Google Colab Form feature in a local Jupyter Notebook?

I have just installed a Jupyter Notebook in a local conda environment, and I've imported an .ipynb file from Google Colab to run it locally.我刚刚在本地conda环境中安装了一个 Jupyter Notebook,并从 Google Colab 导入了一个.ipynb文件以在本地运行它。

I wonder if there's any extension that enables the Form feature from Google Colab to work on a regular Jupyter Notebook, using the same syntax, like this below:我想知道是否有任何扩展使 Google Colab 的表单功能能够在普通的 Jupyter Notebook 上工作,使用相同的语法,如下所示: 在此处输入图像描述

PS: I'm aware of the Jupyter Widgets ( ipywidgets ) package/extension, however the syntax is different from Colab Forms, ideally I would want to keep the same syntax so I could use the same file back and forth between Colab and local easily PS:我知道 Jupyter Widgets ( ipywidgets ) 包/扩展,但是语法与 Colab Forms 不同,理想情况下我想保持相同的语法,这样我就可以轻松地在 Colab 和本地之间来回使用相同的文件

Disclaimer: this is not a strict solution to the problem presented by the OP, but it is a viable alternative.免责声明:这不是 OP 提出的问题的严格解决方案,但它是一个可行的替代方案。

For months I have been looking for a way to have certain Google Colab functionality locally, but to no avail.几个月来,我一直在寻找一种在本地拥有某些 Google Colab 功能的方法,但无济于事。 In particular, to date I haven't found a way to:特别是,到目前为止,我还没有找到一种方法来:

  1. Run Google Colab locally (offline).在本地(离线)运行 Google Colab。
  2. Have the functionalities of Google Colab forms locally (offline) using the same syntax.使用相同的语法在本地(离线)具有 Google Colab forms 的功能。

However, since one of the main motivations for using Jupyter locally is to use the computational resources of the local machine, Google Colab offers a very simple way to take advantage of all the features of the platform using a local Jupyter environment:然而,由于在本地使用 Jupyter 的主要动机之一是使用本地机器的计算资源,Google Colab 提供了一种非常简单的方法来利用本地 Jupyter 环境的平台的所有功能:

  1. Upload your notebook to Google Drive and open it with Google Colab.将您的笔记本上传到 Google 云端硬盘并使用 Google Colab 打开它。
  2. Click the arrow next to the "Connect" button and then click "Connect to a local runtime".单击“连接”按钮旁边的箭头,然后单击“连接到本地运行时”。
  1. Follow the instructions.按照说明进行操作。

Then you can use the same file back and forth between Google Colab and your local environment easily.然后,您可以轻松地在 Google Colab 和本地环境之间来回使用同一个文件。

结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM