如何让ipywidgets在Jupyter Lab工作? [英] How to get ipywidgets working in Jupyter Lab?

查看:433
本文介绍了如何让ipywidgets在Jupyter Lab工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Jupyter Notebook中,ipywidgets工作正常,但它们似乎在Jupyter Lab中无效(据说它比Notebook更好)。



我遵循了这些

解决方案

JupyterLab现在喜欢将不再允许任意javascript 嵌入单元格输出中的模型,是多少交互式Jupyter笔记本模块用于工作。他们现在要求具有交互性的模块创建JupyterLab扩展。 IPyWidgets有一个可以激活的扩展程序在您的命令行上运行它(假设您已经安装了 NodeJS ):

  jupyter labextension install @ jupyter-widgets / jupyterlab-manager 


In Jupyter Notebook, ipywidgets work fine, however they seem to not work in Jupyter Lab (which is supposedly better than Notebook).

I followed these directions.

Step 1: Installed Node.js (https://nodejs.org/en/)

Step 2: Installed requirements on Python 3 with conda:

conda install -c conda-forge ipywidgets
jupyter labextension install @jupyter-widgets/jupyterlab-manager

Unfortunately, basic widgets do not work inside the jupyter lab notebook:

解决方案

JupyterLab now prefers a model where arbitrary javascript is no longer allowed to be embedded in a cell's output, which is how many interactive Jupyter Notebook modules used to work. They now ask that modules with interactivity create a JupyterLab extension. IPyWidgets has an extension that can be activated by running this on your command line (which assumes you already have NodeJS installed):

jupyter labextension install @jupyter-widgets/jupyterlab-manager

这篇关于如何让ipywidgets在Jupyter Lab工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆