【问题标题】:Why dont I get the interactive elements on my Jupyter Notebook?为什么我的 Jupyter Notebook 上没有交互元素?
【发布时间】:2021-07-12 07:27:48
【问题描述】:

我想要交互式过滤器,根据documentation,这个简单的代码应该给我一个过滤器和一个滑块,但它只是给我一个简单的输出。

输入:

from ipywidgets import interact
@interact(x=True, y=1.0)
    def g(x, y):
        return (x, y)

输出:

(True, 1.0)

我尝试在终端上运行它并重新启动内核,但它也没有工作。 Source.

jupyter nbextension enable --sys-prefix --py widgetsnbextension

我应该怎么做才能解决这个问题?

【问题讨论】:

    标签: filter jupyter-notebook interactive ipywidgets


    【解决方案1】:

    我意识到我必须在终端运行python的环境中运行上面的命令。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 2019-06-06
      • 2022-08-18
      • 1970-01-01
      • 2019-11-04
      • 2017-11-03
      相关资源
      最近更新 更多