Installation
Install lacuna-quant from PyPI, add the extras you need, and check the installation with lacuna doctor.
Requirements
- Python 3.11 or newer. Releases are tested on 3.11 to 3.14.
- A platform with a published wheel: Linux on x86-64 or arm64 (glibc 2.28 or newer), macOS on Apple silicon, or Windows on x86-64.
Lacuna has a native core written in Rust. The wheels include it, so you do not need a Rust toolchain. On any other platform, pip falls back to the source distribution, which needs one.
Install
The distribution is called lacuna-quant. The package you import and the command you run are both lacuna.
python -m pip install lacuna-quant Not the lacuna package
The PyPI project named lacuna is unrelated to this one. Installing both puts two distributions in charge of the same lacuna import. If you installed an early Lacuna wheel from GitHub, its metadata used that name too. Removing it also deletes files lacuna-quant shares, so remove both and install again:
python -m pip uninstall lacuna lacuna-quant lacuna-options
python -m pip install lacuna-quant Reinstall lacuna-options afterwards if you use it.
The core depends only on NumPy (2.0 or newer) and Polars (1.30 or newer). Everything else is an extra you opt into:
| Extra | Installs | Enables |
|---|---|---|
statistics | SciPy | Fitting decay curves with fit_decay. |
report | Jinja2, Plotly | The interactive Plotly HTML report, chosen with report.write(..., renderer="plotly") or --html-renderer plotly. The default HTML and the Markdown reports need nothing extra. |
pandas | pandas, PyArrow | Passing pandas DataFrames, or Arrow tables, as inputs. Lacuna converts them to Polars. |
ml | scikit-learn | Nothing in Lacuna itself: it installs scikit-learn to use with as_sklearn_cv, which hands Lacuna’s purged splits to scikit-learn’s model selection. |
duckdb | DuckDB, PyArrow | Reading DuckDB relations and query results. |
all | All of the above |
python -m pip install "lacuna-quant[statistics,report,pandas]" If SciPy or the report extra is missing, fit_decay or the Plotly renderer raises an error saying what to install; for the other extras Lacuna does not check, so you get whatever error the missing library causes. Lacuna never falls back to a different method because a dependency is missing.
The options extension
Research on listed options lives in a separate, separately versioned package. It depends on lacuna-quant 0.13 or 0.14.
python -m pip install lacuna-options See Options research for what it adds.
Check the installation
lacuna doctor --strict lacuna doctor checks the installation without touching your data or the network. It confirms that:
- the package, its metadata and its native core report the same version, and the native core runs;
- no distribution named
lacunais installed alongside it; - your Python version and platform are ones the release was tested on;
- the NumPy and Polars you import match the installed metadata;
- the JSON schemas Lacuna ships with are readable and carry the expected identity;
- any
LACUNA_*settings in your environment are valid.
Each check prints a stable code and a PASS, WARN or FAIL state. The command exits 1 when any check fails. With --strict it also exits 1 on a warning, which is what you want in CI. Warnings include a Python version newer than the tested 3.14 and a platform outside the wheel list, so a strict check fails there even when Lacuna runs. Add --json for output a script can read.
The same check is available from Python:
import lacuna as lc
diagnostics = lc.diagnose_installation()
print(diagnostics.status, diagnostics.healthy) PASS True healthy is true when nothing failed; it stays true if a check only warned. Read status when you need to tell PASS from WARN.
Versions
import lacuna as lc
print(lc.__version__) 0.14.3 Lacuna is pre-1.0. A minor release, such as 0.14 to 0.15, may change public APIs, and the changelog describes each change and how to migrate. Pin a minor version in anything you depend on, and the exact version for an audit you need to reproduce, since a patch release can change audit results:
python -m pip install "lacuna-quant>=0.14.3,<0.15" Releases are published to PyPI and attached, with checksums and build provenance, to each GitHub release.