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

feature: Bumping Pyodide version or allow specifying pyodide version to use #66

Closed
ahuang11 opened this issue Dec 5, 2024 · 2 comments · Fixed by #67
Closed

feature: Bumping Pyodide version or allow specifying pyodide version to use #66

ahuang11 opened this issue Dec 5, 2024 · 2 comments · Fixed by #67
Assignees
Labels
feature New feature or request

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Dec 5, 2024

Is your feature request related to a problem? Please describe.

I want to install Panel with pyodide

import micropip

bk_whl = "https://cdn.holoviz.org/panel/1.5.4/dist/wheels/bokeh-3.6.1-py3-none-any.whl"
pn_whl = "https://cdn.holoviz.org/panel/1.5.4/dist/wheels/panel-1.5.4-py3-none-any.whl"
await micropip.install([bk_whl, pn_whl])

However, I encounter

PythonError: Traceback (most recent call last):
  File "/lib/python311.zip/_pyodide/_base.py", line 540, in eval_code_async
    await CodeRunner(
  File "/lib/python311.zip/_pyodide/_base.py", line 365, in run_async
    await coroutine
  File "", line 5, in 
  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 355, in add_requirement
    await self.add_wheel(wheel, extras=set())
  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 'contourpy>=1.2'.
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.

Describe the solution you'd like

I believe it's a pyodide version mismatch because it works on https://pyodide.org/en/stable/console.html

Describe alternatives you've considered

Additional context

Panel has its own custom Pyodide implementation but would like to use mkdocs for panel-extensions https://panel.holoviz.org/tutorials/basic/size.html

image
@ahuang11 ahuang11 added the feature New feature or request label Dec 5, 2024
@ahuang11 ahuang11 changed the title feature: Bumping Pyodide version feature: Bumping Pyodide version or allow specifying pyodide version to use Dec 5, 2024
@pawamoy
Copy link
Owner

pawamoy commented Dec 5, 2024

Hi @ahuang11, thanks for the request! I'd be open to an option that lets users pick a Pyodide version. In the meantime we can also upgrade the hardcoded version in the formatters/pyodide.py module.

Would you like to send a PR for the latter, or both 🙂?

@ahuang11
Copy link
Contributor Author

ahuang11 commented Dec 5, 2024

Thanks for the quick response! I'd be happy to create a PR for both.

For customizing Pyodide version, I think it's just a matter of checking whether pyodide_version is in options, and if so, formatting this right?
https://github.com/pawamoy/markdown-exec/blob/main/src/markdown_exec/formatters/pyodide.py#L19

pawamoy added a commit that referenced this issue Dec 5, 2024
Also upgrade default version to 0.26.4.

Issue-66: #66
PR-67: #67
Co-authored-by: Timothée Mazzucotelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants