Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot micropip.install("bokeh>=3.4.0") #13817

Open
apoorvkh opened this issue Apr 10, 2024 · 8 comments
Open

[BUG] Cannot micropip.install("bokeh>=3.4.0") #13817

apoorvkh opened this issue Apr 10, 2024 · 8 comments

Comments

@apoorvkh
Copy link

apoorvkh commented Apr 10, 2024

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

@bryevdv
Copy link
Member

bryevdv commented Apr 16, 2024

@philippjfr any thoughts / comments?

@philippjfr
Copy link
Contributor

The problem here is that Pyodide versions ship with patched versions of Bokeh and for each version of Pyodide only a single patched version of bokeh is shipped. This means that you always have to match your Bokeh version and Pyodide version, in the case of Marimo I'm assuming they're using pyodide<0.25 which ships with an older version of Bokeh.

You have two options here:

  1. Stick with bokeh 3.2.2 until Marimo updates to Pyodide 0.25
  2. Explicitly request a patched wheel for 3.4.0, e.g. we maintain one here: https://cdn.holoviz.org/panel/wheels/bokeh-3.4.0-py3-none-any.whl

On our side we should consider if Bokeh could consider providing a wheel that doesn't depend on tornado and contourpy which aren't available in pyodide.

@philippjfr
Copy link
Contributor

philippjfr commented Apr 16, 2024

Oh I guess @ianthomas23 didn't update the bokeh version in pyodide until last week, which means there's currently no version of pyodide that supports bokeh 3.4.0 out of the box.

@ianthomas23
Copy link
Member

On our side we should consider if Bokeh could consider providing a wheel that doesn't depend on tornado and contourpy which aren't available in pyodide.

ContourPy is available in pyodide, as I have said before.

@philippjfr
Copy link
Contributor

ContourPy is available in pyodide, as I have said before.

Ah, that's great news, thanks!

@bryevdv
Copy link
Member

bryevdv commented Apr 16, 2024

I think it's fine to start releasing a tornado-less bokeh, we just have to decide what to call ("bokeh-minimal"?) it and figure out how to support specifying two package configurations.

@apoorvkh
Copy link
Author

Thanks for the discussion!

Maybe it is simplest to add the following to your pyproject.toml?

[project.optional-dependencies]
server = ["tornado>=6.2", ]  # ...
# OR
tornado = ["tornado>=6.2"]

Then, I believe pip install bokeh will not install tornado by default, but pip install bokeh[server] or pip install bokeh[tornado] will.

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

@bryevdv
Copy link
Member

bryevdv commented Apr 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants