Install & Compatibility
Where this runs
tested against v0.5.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.6s · import 0.406s · 244MB
229MB installed
● package 229MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
col
✓ import polars_distance as pld
✗ import polars_distance.polars as pld
The correct import is just the root module; no subpackage.
Compute pairwise Euclidean distance between list columns 'a' and 'b'.
import polars as pl
import polars_distance as pld
df = pl.DataFrame({
"a": [[1.0, 2.0], [3.0, 4.0]],
"b": [[1.5, 2.5], [3.5, 4.5]]
})
df.with_columns(
dist=pld.col("a").pairwise_euclidean(pld.col("b"))
)
Errors
Common errors & fixes
AttributeError: module 'polars_distance' has no attribute 'pairwise_euclidean'
Attempting to call the distance function as a top-level module attribute instead of using the expression API.
fixUse `pld.col('a').pairwise_euclidean(pld.col('b'))` inside `df.with_columns()` or similar. polars.exceptions.ComputeError: ... dtype is not supported
Passing a column with an unsupported dtype (e.g., categorical) to a distance function.
fixCast the column to a supported dtype: `df.with_columns(pl.col('col').cast(pl.Utf8))`. Upgrade
Version history
0.5.3latest on PyPI · released Apr 20, 2025
Audit
Dependencies
No dependency data recorded yet.