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

Can no longer import Panel 1.0.4 in PyScript/Pyodide #5034

Closed
Tracked by #3
owenlamont opened this issue Jun 5, 2023 · 4 comments
Closed
Tracked by #3

Can no longer import Panel 1.0.4 in PyScript/Pyodide #5034

owenlamont opened this issue Jun 5, 2023 · 4 comments
Milestone

Comments

@owenlamont
Copy link
Contributor

ALL software version info

Browser: Vivaldi 6.0.2979.22 (Stable channel) (64-bit)
Panel 1.0.4
Pyscript 2023.03.01
Bokeh 3.1.1
Tried pyodide 0.22.1 and pyodide 0.23.2

Description of expected behavior and the observed behavior

I was able to import Panel 1.0.4 in PyScript just yesterday but now it won't even import. It will no longer install because it apparently can't resolve a version of markdown-it-py that satisfies requirements.

Apologies if I'm raising this in the wrong place, wasn't sure if this is a Panel issue or PyScript issue.

Complete, minimal, self-contained example code that reproduces the issue

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Test Dependencies</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="stylesheet" href="https://pyscript.net/releases/2023.03.1/pyscript.css" />
    <script
            type="text/javascript"
            src="https://cdn.bokeh.org/bokeh/release/bokeh-3.1.1.js"
    ></script>
    <script
            type="text/javascript"
            src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.1.1.min.js"
    ></script>
    <script
            type="text/javascript"
            src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.1.1.min.js"
    ></script>
    <script
            type="text/javascript"
            src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.0.4/dist/panel.min.js"
    ></script>
    <script defer src="https://pyscript.net/releases/2023.03.1/pyscript.js"></script>
</head>
<body>
    <py-config src="./pyscript.toml"></py-config>
    <py-script src="./main.py"></py-script>
    <div id="plot"></div>
</body>
</html>

main.py

print("Hello, World!")

pyscript.toml

name = "Test Dependencies"

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

Stack traceback and/or browser JavaScript console output

(PY1001): Unable to install package(s) 'https://cdn.holoviz.org/panel/1.0.4/dist/wheels/bokeh-3.1.1-py3-none-any.whl,https://cdn.holoviz.org/panel/1.0.4/dist/wheels/panel-1.0.4-py3-none-any.whl'. Reason: Traceback (most recent call last): File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 234, in __step result = coro.throw(exc) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 573, in install await transaction.gather_requirements(requirements) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 333, in gather_requirements await gather(*requirement_promises) File "/lib/python3.10/asyncio/futures.py", line 284, in __await__ yield self # This tells Task to wait for completion. File "/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup future.result() File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 234, in __step result = coro.throw(exc) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 346, in add_requirement await self.add_wheel(wheel, extras=set()) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 463, in add_wheel await self.gather_requirements(wheel.requires(extras)) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 333, in gather_requirements await gather(*requirement_promises) File "/lib/python3.10/asyncio/futures.py", line 284, in __await__ yield self # This tells Task to wait for completion. File "/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup future.result() File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 234, in __step result = coro.throw(exc) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 337, in add_requirement return await self.add_requirement_inner(req) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 448, in add_requirement_inner await self.add_wheel(wheel, req.extras) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 463, in add_wheel await self.gather_requirements(wheel.requires(extras)) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 333, in gather_requirements await gather(*requirement_promises) File "/lib/python3.10/asyncio/futures.py", line 284, in __await__ yield self # This tells Task to wait for completion. File "/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup future.result() File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 232, in __step result = coro.send(None) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 337, in add_requirement return await self.add_requirement_inner(req) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 418, in add_requirement_inner if self.check_version_satisfied(req): File "/lib/python3.10/site-packages/micropip/_micropip.py", line 364, in check_version_satisfied raise ValueError( ValueError: Requested 'markdown-it-py<3.0.0,>=1.0.0', but markdown-it-py==3.0.0 is already installed . Please open an issue at https://github.com/pyscript/pyscript/issues/new if you require help or you think it's a bug.

Screenshots or screencasts of the bug in action

image

@owenlamont
Copy link
Contributor Author

owenlamont commented Jun 5, 2023

I'm not sure if something changed in PyScript or the wheel files - no version numbers have changed that I can see - which is really confusing.

I tested the same code but reverting to Panel 0.14.4 and Bokeh 2.4.3 and that's still fine.

@owenlamont owenlamont changed the title Can no longer import Panel 1.0.4 in Pyscript Can no longer import Panel 1.0.4 in PyScript Jun 5, 2023
@owenlamont
Copy link
Contributor Author

I'm guessing this is probably some dependency update that has broken things and perhaps some version needs to be pinned

@hoxbro
Copy link
Member

hoxbro commented Jun 5, 2023

This was fixed in #5031 and should be available in the next release 1.0.5

@philippjfr
Copy link
Member

The problem is mdit-py-plugins which has not yet released a compatible version. They've already patched it here executablebooks/mdit-py-plugins@c297f7e but haven't released the new version yet.

I also strongly dislike the fact that pyodide will not force a downgrade of an existing installed package leading to unresolvable environments like this.

@philippjfr philippjfr changed the title Can no longer import Panel 1.0.4 in PyScript Can no longer import Panel 1.0.4 in PyScript/Pyodide Jun 5, 2023
@philippjfr philippjfr added this to the v1.1.0 milestone Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants