Install & Compatibility
Where this runs
tested against v3.49.1 · 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
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Live
✓ from dvclive import Live
✗ import dvclive; dvclive.init()
The `dvclive.init()` function was an older pattern. The modern approach is to instantiate and use the `Live` class.
This quickstart demonstrates basic logging of parameters and metrics using `dvclive.Live` within a simulated training loop. Metrics and parameters will be saved in the `dvclive` directory, typically as `metrics.json`, `params.yaml`, and time-series `.tsv` files. Running this code multiple times will generate new experiment steps that can be tracked and compared with DVC.
import time
import random
from dvclive import Live
params = {"learning_rate": 0.002, "optimizer": "Adam", "epochs": 20}
with Live() as live:
# Log parameters
for param in params:
live.log_param(param, params[param])
# Simulate training loop
offset = random.uniform(0.2, 0.1)
for epoch in range(1, params["epochs"]):
fuzz = random.uniform(0.01, 0.1)
accuracy = 1 - (2 ** -epoch) - fuzz - offset
loss = (2 ** -epoch) + fuzz + offset
# Log metrics for the current step
live.log_metric("accuracy", accuracy)
live.log_metric("loss", loss)
live.next_step()
time.sleep(0.05) # Simulate work, shorten for quick demo
dvclive --version
Debug
Known issues
breakingScikit-learn `probas_pred` argument change (v3.48.3 and `sklearn>=1.7`). Older DVCLive versions with `sklearn` 1.7+ might encounter `TypeError: missing a required argument: 'y_score'` when using `live.log_sklearn_plot()`. DVCLive 3.48.3 fixed this internally, so ensure your `dvclive` is updated if you use newer `sklearn`.fixUpgrade DVCLive to version 3.48.3 or newer, or pin `scikit-learn` to a version older than 1.7.
affects: <3.48.3 (with scikit-learn >= 1.7)
breakingDropped Catalyst ML framework integration (v3.47.0). Support for the Catalyst ML framework was removed in DVCLive 3.47.0.fixUsers relying on Catalyst integration must either pin `dvclive` to a version older than 3.47.0 or migrate their logging setup away from Catalyst's DVCLive callback.
affects: >=3.47.0
gotchaMatplotlib `Figure` logging behavior change (v3.48.4). Previously, `live.log_image()` with a matplotlib figure might have implicitly logged the most recently active figure. Since 3.48.4, it strictly logs the `matplotlib.figure.Figure` instance explicitly provided as an argument. Make sure to pass the intended figure object.fixAlways explicitly pass the `matplotlib.figure.Figure` object you intend to log to `live.log_image()` rather than relying on global state.
affects: >=3.48.4
gotchaDVC `live` section deprecation in `dvc.yaml` (DVC 3.0 / DVCLive ~3.0). The `live` section for DVCLive configuration in `dvc.yaml` was deprecated and is no longer the primary way to configure DVCLive. Configuration should primarily be done through the Python `Live` API.fixConfigure `dvclive.Live` instances directly in your Python code using its `__init__` parameters. Avoid relying on or defining the `live` section in `dvc.yaml`.
affects: DVCLive versions integrating with DVC 3.0+
gotcha`save_dvc_exp` ignored in `dvc repro`. When `dvclive` runs as part of a `dvc repro` command, the `save_dvc_exp=True` argument to `Live()` is ignored. DVC experiments will not be automatically saved by `dvclive` in this context.fixTo explicitly save experiments when running within a DVC pipeline, use `dvc exp run` instead of `dvc repro`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dvclive'
The dvclive package is not installed in the Python environment where the code is being executed.
fixInstall the package using pip: `pip install dvclive`
AttributeError: 'Live' object has no attribute 'set_step'
The code is attempting to use a deprecated or changed method (`set_step`) from an older DVCLive API version with a newer installed version of the library.
fixUpdate the code to use the current API for setting the step, which is `live.step = <step_number>`.
FileNotFoundError: [Errno 2] No such file or directory
This error often occurs when DVCLive or DVC (which DVCLive integrates with) cannot find specified output directories, cache files, or data files, or if DVC's cache is not correctly linked or pulled.
fixEnsure that all specified paths (for outputs, artifacts, or DVC-tracked data) are correct and accessible, run `dvc pull` to retrieve data if necessary, and verify DVC cache integrity.
ValueError: I/O operation on closed file.
When using `live.log_artifact()` or other logging functions, certain integrations (e.g., with TensorFlow) might cause standard I/O streams (`stderr` or `stdout`) to be unexpectedly closed, leading to this error during subsequent I/O operations by DVCLive.
fixInvestigate if other libraries are redirecting or closing standard I/O streams; ensure these streams remain open during DVCLive operations or try to isolate the DVCLive logging from the conflicting library's initialization.
Upgrade
Version history
3.49.1latest on PyPI · released Jun 5, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.9 or newer.
dvcoptionalOptional, but highly recommended for full experiment versioning and visualization capabilities.
scikit-learnoptionalRequired for `live.log_sklearn_plot()` methods.
PillowoptionalRequired for `live.log_image()` methods.
matplotliboptionalOften used for custom plot generation, though not a direct dependency of `dvclive` itself, `live.log_image` can log matplotlib figures.