Search code examples
filterjupyter-notebookinteractiveipywidgets

Why dont I get the interactive elements on my Jupyter Notebook?


I would like to have interactive filters, according to the documentation, this simple code should give me a filter and a slider but it just gives me a simple output.

Input:

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

Output:

(True, 1.0)

I tried to run this on the terminal and restarted the Kernel but it didnt work either. Source.

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

What should I do to fix this?


Solution

  • I realized that I had to run the command above in the environment where I am running the python in the terminal.