AttributeError: 'Scatter' object has no attribute 'servable'

Hi all,
I’m new to holoviz.

When I run the following code in Jupyter lab, it runs fine and shows the plot.

But when I run it in python file using .servable() then it throws error:

image

Then I replace plot with table in the python file and it shows fine:

image

I have to mention that at some point I was able to see the scatter plot showed in the application servered by Panel, but it’s acting very random.

What am I missing?

I just enclosed the scatter in a pn.Row() then it showed.
Then I tried to adding box_stream component, then it stopped showing. I guess, something went wrong, so I reversed the change to the point that it was working fine.
Here’s the problem, it’s not showing now. I feel like the error sticks, whenever something goes wrong then even going back to the point that plot was showing doesn’t make it to show again.

Hi @Mana !

Indeed you cannot call .servable on a hvPlot object (objects returned by calls like df.hvplot(...) are actually HoloViews objects, just so you know). But you can just wrap them with pn.panel(plot) and then call .servable on the panel object.

As for the issue you reported in your second message, for the community to help you you will have to provide more context, i.e. your code to reproduce the error and information about your environment (e.g. versions of hvplot, panel, bokeh, jupyterlab).

I feel like the error sticks,

Even after restarting your notebook kernel and re-running the cells?

1 Like

Thanks @maximlt for the response. Regarding the servable call, now, it makes sense. I didn’t realize that.
My second question is about same scenario/code. I’ll try to be more clear in the future.

1 Like