holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.8k stars 519 forks source link

Unable to get interactive plots in a jupyter notebook #7507

Closed kdheepak closed 1 day ago

kdheepak commented 2 days ago

Hi all,

ALL software version info

This is with a new project using uv init:

[project]
name = "panel-example"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "ipykernel>=6.29.5",
    "matplotlib>=3.9.2",
    "nbconvert>=7.16.4",
    "panel>=1.5.4",
]

Description of expected behavior and the observed behavior

I'm able to get an app working when I run panel serve but I don't have the same interactivity in the browser:

https://github.com/user-attachments/assets/badf16ca-513a-4e2a-a6f4-8488f5840832

Complete, minimal, self-contained example code that reproduces the issue

I copied the example code from here:

https://panel.holoviz.org/how_to/styling/matplotlib.html#a-matplotlib-plot-with-custom-style-and-accent-color

I've attached the notebook here as an example:

Archive.zip

kdheepak commented 1 day ago

I had to install jupyter and panel in the same environment. I had jupyter installed in my global environment and panel + ipywidget installed inside the local venv, and in that case panel doesn't appear to work. There also isn't the panel extension button in jupyter lab when I do this.

I got it working now.