pola-rs/polars · error · ModuleNotFoundError

polars.testing.parametric requires the 'hypothesis' module P

Error message

polars.testing.parametric requires the 'hypothesis' module
Please install it using the command: pip install hypothesis

What it means

Import-time guard for polars.testing.parametric: the module checks _HYPOTHESIS_AVAILABLE and raises ModuleNotFoundError before importing any strategies when the optional hypothesis dependency is missing. It fires merely on `import polars.testing.parametric` in an environment without hypothesis installed.

Source

Thrown at py-polars/src/polars/testing/parametric/__init__.py:8

from polars._dependencies import _HYPOTHESIS_AVAILABLE

if not _HYPOTHESIS_AVAILABLE:
    msg = (
        "polars.testing.parametric requires the 'hypothesis' module\n"
        "Please install it using the command: pip install hypothesis"
    )
    raise ModuleNotFoundError(msg)

from polars.testing.parametric.profiles import load_profile, set_profile
from polars.testing.parametric.strategies import (
    column,
    dataframes,
    dtypes,
    lists,
    series,
)

__all__ = [
    # strategies
    "dataframes",
    "series",
    "column",
    "dtypes",
    "lists",
    # profiles

View on GitHub (pinned to 5d8ebabf11)

Solutions

  1. Install hypothesis: `pip install hypothesis` before using `polars.testing.parametric`.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at py-polars/src/polars/testing/parametric/__init__.py:8 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@5d8ebabf11 (2026-08-19). Data as JSON: /api/errors/092904828736f192. Report an issue: GitHub.