[Python] Unable to use dask-sql due to 'dask_expr.io' module

Discussão em 'Python' iniciado por Stack, Julho 7, 2025.

  1. Stack

    Stack Membro Participativo

    Aim:

    1. Read data from Parquet files
    2. Register each df as Table
    3. Use dask-sql to join & query from the table

    Here are the installation step:

    • pip install --force-reinstall --no-cache-dir "dask[complete]" dask-sql
    • pip install dask-expr

    Installed versions:

    import dask
    import dask_sql

    print(dask.__version__)
    print(dask_sql.__version__)
    # output:
    > 2025.5.1
    > 2024.5.0


    Steps to reproduce error with sample CSV file:

    import dask.dataframe as dd
    from dask_sql import Context

    tmp_df = dd.read_csv("./tmp.csv")

    c = Context()
    c.create_table("tmp", df)


    ---------------------------------------------------------------------------
    ModuleNotFoundError Traceback (most recent call last)
    Cell In[2], line 2
    1 c = Context()
    ----> 2 c.create_table("tmp", tmp_df)

    File ~\AppData\Roaming\Python\Python312\site-packages\dask_sql\context.py:266, in Context.create_table(self, table_name, input_table, format, persist, schema_name, statistics, gpu, **kwargs)
    264 try:
    265 if dd._dask_expr_enabled():
    --> 266 from dask_expr.io.parquet import ReadParquet
    268 dask_filepath = None
    269 operations = input_table.find_operations(ReadParquet)

    ModuleNotFoundError: No module named 'dask_expr.io'


    Note: even after installing pip install dask-expr I am getting the same error.

    Continue reading...

Compartilhe esta Página