No module named 'dask_expr.io'

I created a conda environment with Python 3.12 and then pip installed dask, dask-sql, and dask-expr but when I try create_table on a dask_sql Context, it gives me the error about no module name dask_expr.io. I think I also did the same process but from conda-forge and with a different Python version and still get the same error. Any help? Thanks.

Hi @DrTodd13,

On which OS, and how did you install this environment? Could you share the commands and packages versions you get?

If you use only conda and conda-forge channel, I don’t see why this would fail.

Hello community.

Were you able to solve this, @DrTodd13 ?

I am having the same issue with an environment setup with UV.

OS is Windows 11 Enterprise, Version 10.0.26100 Build 26100.
Running from VS Code 1.98.2.
Running with Python 3.13.
Dependencies are resolved with “uv sync”.

pyproject.toml:

[project]
name = "dask-sql-example"
version = "0.1.0"
description = "Dask SQL Example"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
    "dask[complete]>=2025.2.0",
    "dask-sql>=2024.5.0",
    "dask-expr>=2.0.0",
    "distributed>=2025.2.0",
    "pandas>=2.2.3",
    "pyarrow>=19.0.1",
]

main.py:

import dask.dataframe as dd
import pandas as dp
from dask_sql import Context


def start() -> None:
        query = "select line_item_product_code from raw_data"

        pdf = dp.DataFrame(
            {
                "line_item_product_code": ["AmazonEC2", "AmazonRDS"],
                "line_item_line_item_type": ["RIFee", "DiscountedUsage"],
                "pricing_purchase_option": ["All Upfront", "Partial Upfront"],
                "reservation_reservation_arn": ["arn:aws:1", "arn:aws:2"],
                "line_item_net_unblended_rate": [1.0, 2.0],
            }
        )
        dataframe = dd.from_pandas(pdf, npartitions=2)

        c = Context()
        c.create_table("raw_data", dataframe)
        result = c.sql(query).compute()
        print(result.head())


if __name__ == "__main__":
    start()

Exception stack:

Traceback (most recent call last):
  File "c:\code\dask-sql-example\app\main.py", line 27, in <module>
    start()
    ~~~~~^^
  File "c:\code\dask-sql-example\app\main.py", line 21, in start
    c.create_table("raw_data", dataframe)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\code\dask-sql-example\.venv\Lib\site-packages\dask_sql\context.py", line 266, in create_table
    from dask_expr.io.parquet import ReadParquet
ModuleNotFoundError: No module named 'dask_expr.io'

Is this information enough?
Any help is appreciated.

Thank you.

What I see is that dask-sql is not well maintained currently.

Since 2025.1.0 Dask release, dask-expr was merged in Dask. It is possible that latest versions of dask or dask-expr package are not well supported by dask-sql. I guess you’ll need to try with older versions of them.