{"record":{"id":"2c9c0ea8d5384204","repo":"mlflow/mlflow","slug":"invalid-parameter-value-2c9c0e","errorCode":"INVALID_PARAMETER_VALUE","errorMessage":"Invalid pip_requirements for job function: {pip_requirements}, parsing error: {e!r}","messagePattern":"Invalid pip_requirements for job function: (.+?), parsing error: (.+?)","errorType":"error_code","errorClass":"MlflowException","httpStatus":400,"severity":"error","filePath":"mlflow/server/jobs/__init__.py","lineNumber":111,"sourceCode":"            relative file references such as \"-r requirements.txt\" are not supported.\n        exclusive: (optional) If True, only one instance of this job with the same params\n            can run at a time. If a list of parameter names is provided, only those\n            parameters are considered when determining exclusivity. Default is False.\n    \"\"\"\n    from mlflow.utils import PYTHON_VERSION\n    from mlflow.utils.requirements_utils import _parse_requirements\n    from mlflow.version import VERSION\n\n    if not python_version and not pip_requirements:\n        python_env = None\n    else:\n        python_version = python_version or PYTHON_VERSION\n        try:\n            pip_requirements = [\n                req.req_str for req in _parse_requirements(pip_requirements, is_constraint=False)\n            ]\n        except Exception as e:\n            raise MlflowException.invalid_parameter_value(\n                f\"Invalid pip_requirements for job function: {pip_requirements}, \"\n                f\"parsing error: {e!r}\"\n            )\n        if mlflow_home := os.environ.get(\"MLFLOW_HOME\"):\n            # Append MLflow dev version dependency (for testing)\n            pip_requirements += [mlflow_home]\n        else:\n            pip_requirements += [f\"mlflow=={VERSION}\"]\n\n        python_env = _PythonEnv(\n            python=python_version,\n            dependencies=pip_requirements,\n        )\n\n    def decorator(fn: Callable[P, R]) -> Callable[P, R]:\n        fn._job_fn_metadata = JobFunctionMetadata(\n            name=name,\n            fn_fullname=f\"{fn.__module__}.{fn.__name__}\",","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/server/jobs/__init__.py#L93-L129","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","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'])"],"exampleFix":"// before\n@job(pip_requirements=[\"numpy>=\", \"pandas\"])\n// after\n@job(pip_requirements=[\"numpy>=1.24\", \"pandas==2.1.0\"])","handlingStrategy":"validation","validationCode":"from packaging.requirements import Requirement\n\ndef validate_pip_requirements(reqs):\n    for r in reqs:\n        try:\n            Requirement(r)\n        except Exception as e:\n            raise ValueError(f\"Bad requirement {r!r}: {e}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["validation","pip","parameters","jobs"],"backgroundTag":"invalid-pip-requirement","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}