{"id":8239,"library":"ipytree","title":"ipytree","description":"ipytree is a Python library that provides an interactive Tree Widget for Jupyter environments, built using the Jupyter-widgets protocol and jsTree. It offers an easy-to-use interface to visualize and manipulate hierarchical data structures directly within Jupyter Notebooks and JupyterLab, and can be seamlessly integrated with other `ipywidgets` components.","status":"active","version":"0.2.2","language":"en","source_language":"en","source_url":"https://github.com/martinRenou/ipytree","tags":["jupyter","widget","treeview","jsTree","interactive","frontend"],"install":[{"cmd":"pip install ipytree","lang":"bash","label":"Install with pip"},{"cmd":"conda install -c conda-forge ipytree","lang":"bash","label":"Install with Conda"}],"dependencies":[{"reason":"Core dependency for Jupyter interactive widgets.","package":"ipywidgets"},{"reason":"Required for displaying the widget in JupyterLab, ideally version 3.0+ for simplified extension management.","package":"jupyterlab"}],"imports":[{"symbol":"Tree","correct":"from ipytree import Tree"},{"symbol":"Node","correct":"from ipytree import Node"}],"quickstart":{"code":"from ipytree import Tree, Node\n\n# Create a root node\nroot_node = Node('Root')\n\n# Add child nodes\nchild1 = Node('Child 1')\nchild2 = Node('Child 2')\nroot_node.add_node(child1)\nroot_node.add_node(child2)\n\n# Add a nested node\nsub_child = Node('Sub Child')\nchild1.add_node(sub_child)\n\n# Create the tree widget and add the root node\ntree = Tree(nodes=[root_node])\n\n# Display the tree\ntree","lang":"python","description":"This example demonstrates how to create a basic hierarchical tree structure using `ipytree.Tree` and `ipytree.Node` objects, and then display it in a Jupyter environment. Nodes can be added and nested to form complex structures."},"warnings":[{"fix":"Upgrade `ipywidgets` to 8.0.6 or newer, which includes a fix for the `structuredClone` issue. Alternatively, downgrade `ipywidgets` to 8.0.4 or earlier.","message":"Users of `ipywidgets` version 8.0.5 may encounter issues with `ipytree` functionality due to changes in how widgets handle structured cloning (`structuredClone`). This affected default serializers.","severity":"breaking","affected_versions":"ipytree 0.2.2 with ipywidgets 8.0.5"},{"fix":"For JupyterLab <=2, run `jupyter labextension install @jupyter-widgets/jupyterlab-manager ipytree`. For Jupyter Notebook <=5.2, run `jupyter nbextension enable --py --sys-prefix ipytree`. Modern JupyterLab 3+ and `ipywidgets >= 7.6.0` generally handle this automatically.","message":"Older JupyterLab versions (<=2) and classic Jupyter Notebook (version 5.2 or below) required explicit manual installation and enabling of Jupyter extensions for `ipytree` to display correctly.","severity":"gotcha","affected_versions":"<= JupyterLab 2, <= Jupyter Notebook 5.2"},{"fix":"Ensure your JupyterLab/Notebook environment is up-to-date and that `ipywidgets` and `ipytree` are installed correctly. In some cases, a `jupyter lab build` might be necessary if manual extension management was performed, though typically `pip install` or `conda install` should suffice for modern setups. Consult the specific environment's documentation for widget compatibility.","message":"When running `ipytree` in environments like VS Code's Jupyter integration or certain cloud notebooks (e.g., EMR), users may encounter 'Error displaying widget' if the frontend extension isn't correctly loaded or compatible.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"For JupyterLab 3+ and `ipywidgets >= 7.6.0`, reinstall `ipytree` to trigger automatic extension registration. For older environments, manually install/enable the extensions as described in the warnings. Ensure Python kernel is restarted.","cause":"The `ipytree` JupyterLab or Notebook extension is not properly installed or enabled, or there's a compatibility issue with the Jupyter frontend.","error":"Error displaying widget"},{"fix":"Update `ipywidgets` to version 8.0.6 or newer, or downgrade it to 8.0.4 or earlier.","cause":"This error specifically occurred with `ipywidgets` version 8.0.5, which introduced a change related to `structuredClone` that affected `ipytree` and other custom widgets.","error":"Uncaught DOMException: Failed to execute 'structuredClone' on 'Window': # could not be cloned."}]}