bokeh: [BUG] Cannot `micropip.install("bokeh>=3.4.0")`

Expected behavior

I would like to be able to install bokeh in WebAssembly environments (e.g. using marimo).

import micropip
await micropip.install("bokeh>=3.4.0")

Also relevant to: hvplot/holoviews (cc: @philippjfr) and marimo (cc: @akshayka) as my goal is to use hvplot in (web-only) marimo: await micropip.install("hvplot") fails for this underlying reason

Observed behavior

The following code fails

import micropip
await micropip.install("bokeh>=3.4.0")

with the following error: ValueError: Can't find a pure Python 3 wheel for 'tornado>=6.2'.

However, this is actually successful:

await micropip.install("bokeh==3.2.2")

(and it does not install tornado, even though tornado>=5.1 is a dependency of bokeh==3.2.2 and await micropip.install("tornado>=5.1") also fails)

Is it possible to fix bokeh>3.2.2 so that we can install it (without tornado) in WebAssembly environments with micropip?

Thank you!

Example code

Marimo Web Notebook

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 29 (24 by maintainers)

Most upvoted comments

show() opens in a new tab when running locally, which doesn’t work when running in Wasm

That’s because the default output mode is output_file but in the notebook users are expected to run output_notebook first to enable show to display inline in notebooks (see my jupyter-lite screenshot above). So the proper way to come at this, I think, is to get output_notebok working in you case. Note that there is actually a “notebook hooks” system to allow other notebook vendors to customize how show behaves in their notebook. If the patch is simple, generic enough we might consider including it in Bokeh directly, but the main idea behind notebook hooks is so that other notebook projects can maintain and provide their own hook implementations separately for their users to use so that projects do not become overly coupled.

Outputting just p does work in marimo, though looks like outputting p.scatter() doesn’t. That’s an error on our end.

Well, sort of. The result of p.scatter is not a plot, so it is not expected to display a plot or be an argument to show. The output of p.scatter is a glyph renderer which does have an HTML repr, just not a plot (See the bold GlyphRenderer in my screenshot above, it can be expanded to see all the properties of the render, but it is purely a textual representation). It is true that I would expect that HTML repr to work, though.

@akshayka can you open a separate GH development discussion around marino integration? We can sort out details of waht should go where once we have some idea of the technical needs.

How does that sound? Sorry if it’s no good, I’m a bokeh / packaging novice.

AFAIK conda does not support optional dependencies, and I am personally 👎 for any solution that puts pip / conda options on different footing. I’d rather just have a separate package entirely that can specify the same set of reduced dependencies in both cases.

Also, I would not want “without server” to become the default. pip install bokeh and conda install bokeh should both include everything necessary to run Bokeh server applications. Changing that now would break the setup workflow for every Bokeh server user overnight.