Skip to content

Pointblank packaging error when used in marimo WASM notebooks #238

@paddymul

Description

@paddymul

Prework

Description

Pointblank doesn't import properly into marimo WASM notebooks because of a narwhals packaging conflict

Reproducible example

The following code in marimo

import sys

if "pyodide" in sys.modules:  # make sure we're running in pyodide/WASM
    import micropip
    await micropip.install("pointblank")

import pointblank as pb

This throws the following error.

Traceback (most recent call last):
  File "/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 112, in execute_cell_async
    await eval(cell.body, glbls)
  Cell 
marimo://notebook.py#cell=cell-0
, line 10, in <module>
    await micropip.install("pointblank")
  File "/lib/python3.12/site-packages/micropip/package_manager.py", line 133, in install
    return await install(
           ^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/install.py", line 53, in install
    await transaction.gather_requirements(requirements)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 62, in add_requirement
    return await self.add_requirement_inner(Requirement(req))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 152, in add_requirement_inner
    await self._add_requirement_from_package_index(req)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 214, in _add_requirement_from_package_index
    await self.add_wheel(wheel, req.extras, specifier=str(req.specifier))
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 262, in add_wheel
    await asyncio.gather(
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
    await asyncio.gather(*requirement_promises)
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 59, in add_requirement
    return await self.add_requirement_inner(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 141, in add_requirement_inner
    satisfied, ver = self.check_version_satisfied(req)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/micropip/transaction.py", line 86, in check_version_satisfied
    raise ValueError(
ValueError: Requested 'narwhals>=1.41.0', but narwhals==1.24.1 is already installed

You can try my example here
https://marimo.io/p/@paddy-mullen/notebook-f9ojwj

  • [X ] Post a minimal reproducible example (MRE) so the maintainer can troubleshoot the problems you identify. A reproducible example is:
    • [ X] Runnable: post enough code and data so any onlooker can create the error on their own computer.
    • [ X] Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the Style Guide for Python Code.

Expected result

You should be able to play with Pointblank in WASM/Pyodide marimo notebooks.

Development environment

  • Operating System: [e.g., Linux, macOS, Windows]
  • Pointblank Version: latest?

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions