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

Unable to run ibis in marimo WebAssembly notebooks #3501

Closed
kyrre opened this issue Jan 19, 2025 · 4 comments · Fixed by #3507
Closed

Unable to run ibis in marimo WebAssembly notebooks #3501

kyrre opened this issue Jan 19, 2025 · 4 comments · Fixed by #3507
Labels
bug Something isn't working

Comments

@kyrre
Copy link

kyrre commented Jan 19, 2025

Describe the bug

Both Ibis and it's DuckDB backend works on pyodide, but somehow it doesn't work when using it in marimo.

I have created an issue over at the ibis-project's issue tracker ibis-project/ibis#10687.

Environment

{
  "marimo": "0.10.14",
  "OS": "Darwin",
  "OS Version": "24.2.0",
  "Processor": "arm",
  "Python Version": "3.12.7",
  "Binaries": {
    "Browser": "132.0.6834.83",
    "Node": "v18.16.0"
  },
  "Dependencies": {
    "click": "8.1.8",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.7",
    "narwhals": "1.22.0",
    "packaging": "24.2",
    "psutil": "6.1.1",
    "pygments": "2.19.1",
    "pymdown-extensions": "10.14",
    "pyyaml": "6.0.2",
    "ruff": "0.9.2",
    "starlette": "0.45.2",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.34.0",
    "websockets": "14.1"
  },
  "Optional Dependencies": {
    "anywidget": "0.9.13",
    "duckdb": "1.1.3",
    "ibis-framework": "9.5.0",
    "pandas": "2.2.3",
    "pyarrow": "17.0.0"
  }
}

Code to reproduce

import marimo

__generated_with = "0.10.14"
app = marimo.App(width="medium")


@app.cell
def _():
    import marimo as mo
    return (mo,)


@app.cell
def _():
    import ibis
    return (ibis,)


@app.cell
def _(ibis):
    ibis.duckdb.connect(":memory:")
    return


@app.cell
def _():
    return


if __name__ == "__main__":
    app.run()
marimo export html-wasm minimal.py -o output_dir --mode edit
@kyrre kyrre added the bug Something isn't working label Jan 19, 2025
@mscolnick
Copy link
Contributor

mscolnick commented Jan 19, 2025

I am also unable to get it to run, for a further reason. Because ibis does not have a straightforward installation. You would need to install with micropip:

EDIT: I was wrong. ibis does work if you install with:

import micropip
import duckdb
import sqlite3
await micropip.install("ibis-framework[duckdb]")
import ibis

https://marimo.app/l/y2j3qs

@kyrre
Copy link
Author

kyrre commented Jan 19, 2025

@mscolnick could it be that the pyodide version is < 0.27.1? ibis-project/ibis#10687 (comment)

🙏🏻

@mscolnick
Copy link
Contributor

I updated my original comment. Here is a working example https://marimo.app/l/y2j3qs

@mscolnick
Copy link
Contributor

What happens currently is that we try to auto-install ibis, which is another package under the name ibis, but the actual package you want is ibis-framework.

We do have some opinionated logic of mapping these edge cases to the more common package (e.g. PIL, sklearn), but we did not extend this logic to microppips auto-install. I've fixed that here: #3507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants