Skip to content

Broken examples using Panel (& Fix) #17

@FlorianKrach

Description

@FlorianKrach

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

Problem

All the PyScript examples using Panel provided at https://pyscript.com/@examples currently don't work, see for example https://pyscript.com/@examples/streaming-in-panel/latest. I used "Safari" and "Chrome", but the problem seems to be independent of the browser.

As far as I can judge (but I am not an expert), the issue seems to be that there was some update in Bokeh or Panel during the last weeks, which now need to install two libraries for which no pure python wheels are available (ValueError: Can't find a pure Python 3 wheel for: 'tornado>=6.2', 'contourpy>=1.2').
As a result, this breaks all PyScript apps using Panel, where Bokeh and Panel are installed via

packages = ["bokeh==3.2.2", "panel"]

or similarly.

Fix

A way to circumvent this is by installing the Panel and Bokeh packages directly from the wheels provided by Holoviz, as was outlined here: holoviz/panel#4572 (comment). In particular, by replacing the above by:

packages=[
    "https://cdn.holoviz.org/panel/0.14.4/dist/wheels/bokeh-2.4.3-py3-none-any.whl",
    "https://cdn.holoviz.org/panel/0.14.4/dist/wheels/panel-0.14.4-py3-none-any.whl",
]

Note: there are already newer versions of Bokeh and Panel available, but this also works (at least when adjusting the script tags accordingly).

Since the provided PyScript examples currently don't work, I thought you might want to update them using this fix. I am sorry in case I reported the problem at the wrong place. Thank you for the great tool you provide with PyScript!

What browsers are you seeing the problem on? (if applicable)

No response

Console info

Uncaught (in promise) PythonError: Traceback (most recent call last):
  File "/lib/python3.11/site-packages/micropip/_commands/install.py", line 146, in install
    raise ValueError(
ValueError: Can't find a pure Python 3 wheel for: 'contourpy>=1.2', 'tornado>=6.2'
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package


    at new_error (pyodide.asm.js:9:12519)
    at pyodide.asm.wasm:0x158827
    at pyodide.asm.wasm:0x15fcd5
    at _PyCFunctionWithKeywords_TrampolineCall (pyodide.asm.js:9:123052)
    at pyodide.asm.wasm:0x1a3091
    at pyodide.asm.wasm:0x289e4d
    at pyodide.asm.wasm:0x1e3f77
    at pyodide.asm.wasm:0x1a3579
    at pyodide.asm.wasm:0x1a383a
    at pyodide.asm.wasm:0x1a38dc
    at pyodide.asm.wasm:0x2685c5
    at pyodide.asm.wasm:0x26e3d0
    at pyodide.asm.wasm:0x1a3a04
    at pyodide.asm.wasm:0x1a3694
    at pyodide.asm.wasm:0x15f45e
    at Module.callPyObjectKwargs (pyodide.asm.js:9:81732)
    at Module.callPyObject (pyodide.asm.js:9:82066)
    at wrapper (pyodide.asm.js:9:58562)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions