mlflow/mlflow · error · MlflowException
INVALID_PARAMETER_VALUE
INVALID_PARAMETER_VALUE
Error message
Invalid pip_requirements for job function: {pip_requirements}, parsing error: {e!r} What it means
`mlflow.server.jobs.job` validates the `pip_requirements` argument by parsing it with pip's requirement parser before creating a job. If any requirement string cannot be parsed (malformed specifier, bad URL, invalid extras, non-string entry), an MlflowException with INVALID_PARAMETER_VALUE is raised naming the offending list and the parse error.
Source
Thrown at mlflow/server/jobs/__init__.py:111
relative file references such as "-r requirements.txt" are not supported.
exclusive: (optional) If True, only one instance of this job with the same params
can run at a time. If a list of parameter names is provided, only those
parameters are considered when determining exclusivity. Default is False.
"""
from mlflow.utils import PYTHON_VERSION
from mlflow.utils.requirements_utils import _parse_requirements
from mlflow.version import VERSION
if not python_version and not pip_requirements:
python_env = None
else:
python_version = python_version or PYTHON_VERSION
try:
pip_requirements = [
req.req_str for req in _parse_requirements(pip_requirements, is_constraint=False)
]
except Exception as e:
raise MlflowException.invalid_parameter_value(
f"Invalid pip_requirements for job function: {pip_requirements}, "
f"parsing error: {e!r}"
)
if mlflow_home := os.environ.get("MLFLOW_HOME"):
# Append MLflow dev version dependency (for testing)
pip_requirements += [mlflow_home]
else:
pip_requirements += [f"mlflow=={VERSION}"]
python_env = _PythonEnv(
python=python_version,
dependencies=pip_requirements,
)
def decorator(fn: Callable[P, R]) -> Callable[P, R]:
fn._job_fn_metadata = JobFunctionMetadata(
name=name,
fn_fullname=f"{fn.__module__}.{fn.__name__}",View on GitHub (pinned to 6a27f2decc)
Solutions
- Inspect the quoted pip_requirements in the message and fix the malformed entry
- Validate requirements locally with `pip install --dry-run -r` or pkg_resources before submitting
- Pass a list of well-formed PEP 508 requirement strings (e.g. ['mlflow>=2.0', 'pandas==2.1.0'])
Example fix
// before @job(pip_requirements=["numpy>=", "pandas"]) // after @job(pip_requirements=["numpy>=1.24", "pandas==2.1.0"])
Defensive patterns
Strategy: validation
Validate before calling
from packaging.requirements import Requirement
def validate_pip_requirements(reqs):
for r in reqs:
try:
Requirement(r)
except Exception as e:
raise ValueError(f"Bad requirement {r!r}: {e}") Prevention
- Keep pip_requirements as literal PEP 508 strings, not interpolated fragments
- Lint requirement strings in CI with packaging.requirements
- Never pass a file path where a list of requirement strings is expected
When it happens
Trigger: Calling mlflow.server.jobs.job(...) (or the decorated job submission flow) with pip_requirements containing a malformed string like 'numpy>=', 'invalid package!', a local path with bad syntax, or non-string values.
Common situations: Hand-built requirement strings with typos or missing version comparators; passing a requirements.txt file path instead of parsed lines; interpolating variables that produce empty or invalid specifiers.
Related errors
- INVALID_PARAMETER_VALUE
- INVALID_PARAMETER_VALUE
- INVALID_PARAMETER_VALUE
- Cannot specify both '{old_param}' (deprecated) and '{new_par
- INVALID_PARAMETER_VALUE
AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29).
Data as JSON: /api/errors/2c9c0ea8d5384204.
Report an issue: GitHub.