Skip to content

OSError when trying to use polars in PyCafe #20467

Open

Description

@MarcSkovMadsen

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

Open on PY.CAFE

Log output

image

ERROR:bokeh.application.application:Error running application handler <panel.io.handlers.ScriptHandler object at 0x3c43180>: No such device (os error 43)
File 'functions.py', line 682, in _read_csv_impl:
pydf = PyDataFrame.read_csv( Traceback (most recent call last):
  File "/lib/python3.12/site-packages/panel/io/handlers.py", line 412, in run
    exec(self._code, module.__dict__)
  File "/home/pyodide/project-files/app.py", line 7, in <module>
    df = pl.read_csv(path)
         ^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/polars/_utils/deprecation.py", line 92, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/polars/io/csv/functions.py", line 534, in read_csv
    df = _read_csv_impl(
         ^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/polars/io/csv/functions.py", line 682, in _read_csv_impl
    pydf = PyDataFrame.read_csv(
           ^^^^^^^^^^^^^^^^^^^^^
OSError: No such device (os error 43)

Issue description

I saw in https://x.com/DataPolars/status/1871786600981819805 that it should now be possible to use polars with pyodide. So I thought I would like to try it in py.cafe. After some struggling I found out how to extract the wheel from github action artifact. But when using the library I get OSError.

Expected behavior

I would expect to be able to use Polars in pyodide and pycafe.

Installed versions

https://py.cafe/gh/artifact/pola-rs/polars/2358555701/polars-1.18.0-cp39-abi3-emscripten_3_1_58_wasm32.whl

Activity

  1. added
    bugSomething isn't working
    needs triageAwaiting prioritization by a maintainer
    pythonRelated to Python Polars
    on Dec 26, 2024
  2. MarcSkovMadsen commented on Dec 26, 2024

    @MarcSkovMadsen
    Author

    If I load data from a https url instead of "local file" it seems to work.

    Next blocker is that Py.CAFE does not allow me to install altair>=5.4.0 for plotting with polars.

    Open on PY.CAFE

    image

  3. MarcSkovMadsen commented on Dec 26, 2024

    @MarcSkovMadsen
    Author

    Ok. I can try to use Altair or hvplot directly as described in Polars Dataviz Guide. Unfortunately both altair and hvplot require pyarrow installed. It should be possible to install pyarrow in pyodide. But I'm not able to as I get

    RuntimeError: No universal wheels found for pyarrow 18.1.0

    image

    Open reproducible example on PY.CAFE

  4. changed the title [-]OSError when trying to user polars in PyCafe[/-] [+]OSError when trying to use polars in PyCafe[/+] on Dec 26, 2024
  5. MarcSkovMadsen commented on Dec 26, 2024

    @MarcSkovMadsen
    Author

    If I stay with Matplotlib I can get some data visualization

    image

    Reproduce on PY.CAFE

  6. MarcSkovMadsen commented on Dec 27, 2024

    @MarcSkovMadsen
    Author

    Ok. I've learned in apache/arrow#34996 (comment) that pyarrow will be available when Pyodide 0.27.0 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAwaiting prioritization by a maintainerpythonRelated to Python Polars

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions