-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Using Panel in Pyodide outdated #5307
Comments
Seems like the valid versions of the panel and bokeh js files can be found in https://panel.holoviz.org/how_to/wasm/jupyterlite.html UPDATE: The latest versions are https://cdn.holoviz.org/panel/1.2.0/dist/wheels/bokeh-3.2.0-py3-none-any.whl But they should be (@philippjfr ) https://cdn.holoviz.org/panel/1.2.1/dist/wheels/bokeh-3.2.0-py3-none-any.whl |
Maybe we should have a |
I'm trying to fix the issue. With the following html <html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-3.2.0.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.2.0.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.2.0.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.2.0/dist/panel.min.js"></script>
</head>
<body>
<div id="simple_app"></div>
<script type="text/javascript">
async function main(){
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await micropip.install('panel')
pyodide.runPython(`
import panel as pn
pn.extension(sizing_mode="stretch_width")
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
def callback(new):
return f'Amplitude is: {new}'
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app');
`);
}
main();
</script>
</body>
</html> After starting the web server with Uncaught (in promise) PythonError: Traceback (most recent call last):
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 576, in install
await transaction.gather_requirements(requirements)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 342, in gather_requirements
await gather(*requirement_promises)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 349, in add_requirement
return await self.add_requirement_inner(Requirement(req))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 457, in add_requirement_inner
await self.add_wheel(wheel, req.extras)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 472, in add_wheel
await self.gather_requirements(wheel.requires(extras))
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 342, in gather_requirements
await gather(*requirement_promises)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 346, in add_requirement
return await self.add_requirement_inner(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 457, in add_requirement_inner
await self.add_wheel(wheel, req.extras)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 472, in add_wheel
await self.gather_requirements(wheel.requires(extras))
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 342, in gather_requirements
await gather(*requirement_promises)
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 346, in add_requirement
return await self.add_requirement_inner(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 444, in add_requirement_inner
wheel = find_wheel(metadata, req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/micropip/_micropip.py", line 312, in find_wheel
raise ValueError(
ValueError: Can't find a pure Python 3 wheel for 'tornado>=5.1'.
See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel
You can use `micropip.install(..., keep_going=True)`to get a list of all packages with missing wheels.
PythonError https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
new_error https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
_PyCFunctionWithKeywords_TrampolineCall https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
callPyObjectKwargs https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
callPyObject https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
wrapper https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
setTimeout handler*hiwire_call_bound https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
_PyCFunctionWithKeywords_TrampolineCall https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
callPyObjectKwargs https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
callPyObject https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
wrapper https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
setTimeout handler*hiwire_call_bound https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9
_PyCFunctionWithKeywords_TrampolineCall https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.asm.js:9 |
Let me have a look |
I can see this one works <html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-3.2.0.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.2.0.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.2.0.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.2.0/dist/panel.min.js"></script>
</head>
<body>
<div id="simple_app"></div>
<script type="text/javascript">
async function main(){
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await micropip.install([
"https://cdn.holoviz.org/panel/1.2.0/dist/wheels/bokeh-3.2.0-py3-none-any.whl",
"https://cdn.holoviz.org/panel/1.2.0/dist/wheels/panel-1.2.0-py3-none-any.whl"]
)
pyodide.runPython(`
import panel as pn
pn.extension(sizing_mode="stretch_width")
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
def callback(new):
return f'Amplitude is: {new}'
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app');
`);
}
main();
</script>
</body>
</html> |
The description in https://panel.holoviz.org/how_to/wasm/standalone.html uses outdated versions of Panel.
The text was updated successfully, but these errors were encountered: