qlib icon indicating copy to clipboard operation
qlib copied to clipboard

[Bug] pyqlib 0.9.7 installs with unbounded mlflow; R.start() raises MlflowException on fresh environments

Open chz03 opened this issue 1 month ago • 1 comments

Bug Description

A fresh pip install pyqlib (0.9.7, the current release) resolves to the latest mlflow, whose filesystem tracking backend now refuses to start by default. qlib.init(...) succeeds, but the first R.start(...) raises:

mlflow.exceptions.MlflowException: The filesystem tracking backend (e.g., './mlruns') is in maintenance mode and will not receive further updates. Please migrate to a database backend (e.g., 'sqlite:///mlflow.db') to access the latest MLflow features. ... If the filesystem backend is required for your workflow, set MLFLOW_ALLOW_FILE_STORE=true to opt out of this exception.

Reproduce

python -m venv .venv && .venv/Scripts/python -m pip install pyqlib   # pulls mlflow >= 3.13
import qlib
qlib.init(provider_uri="~/.qlib/qlib_data/cn_data", region="cn")
from qlib.workflow import R
with R.start(experiment_name="repro"):
    R.log_metrics(m1=1.0)
  • Environment: Windows 11, Python 3.12.10, pyqlib 0.9.7 (PyPI wheel), mlflow as resolved by pip today.

Expected Behavior

The published release either constrains mlflow to a compatible range or works out of the box with the resolved version.

Additional Notes

  • main already pins mlflow<3.13 in pyproject.toml (with a comment in .github/ci/constraints.txt: "Qlib still uses MLflow's filesystem tracking backend"), and CI sets MLFLOW_ALLOW_FILE_STORE=true — but that bound has not shipped in a release, so 0.9.7 users get the incompatible version with no documented env var.
  • Possible remedies: ship a 0.9.8 with the mlflow<3.13 bound (release-level fix), and/or set os.environ.setdefault("MLFLOW_ALLOW_FILE_STORE", "true") before importing mlflow in qlib.workflow so the default recorder works regardless of the installed mlflow version.

🤖 Generated with Claude Code

chz03 avatar Oct 26 '26 12:10 chz03

Hi! I submitted a fix in #2399 that complements the dependency constraint in pyproject.toml by also setting os.environ.setdefault('MLFLOW_ALLOW_FILE_STORE', 'true') in qlib.workflow before constructing MlflowClient instances (matching the CI workflow environment default while preserving any explicit user override).

X6M-Work avatar Nov 09 '26 00:11 X6M-Work