交互式Jupyter窗口小部件在Jupyter Lab中不起作用 [英] Interactive Jupyter Widgets not working in Jupyter Lab

查看:139
本文介绍了交互式Jupyter窗口小部件在Jupyter Lab中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到交互式小部件在我的计算机中无法正常工作Jupyter Lab笔记本.

I noticed that interactive widgets are not working in my Jupyter Lab notebooks.

以下代码应产生一个交互式滑块,但不会:

The following code should produce an interactive slider but doesn't:

from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets

def f(x):
    return x

interact(f, x=10);

这是什么问题,如何使小部件正常工作?

What is the problem here, and how can I get widgets to work?

推荐答案

您需要安装窗口小部件扩展

You need to install widget extension

pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension --sys-prefix

这篇关于交互式Jupyter窗口小部件在Jupyter Lab中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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