{"record":{"id":"a914b4921203ccb2","repo":"docling-project/docling","slug":"qwen-vl-utils-is-required-for-nuextract-extraction","errorCode":null,"errorMessage":"qwen-vl-utils is required for NuExtract extraction. Please install it with: pip install qwen-vl-utils","messagePattern":"qwen-vl-utils is required for NuExtract extraction\\. Please install it with: pip install qwen-vl-utils","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"docling/models/extraction/prompt_utils.py","lineNumber":26,"sourceCode":"\nfrom PIL.Image import Image\n\n\ndef build_nuextract_inputs(\n    processor: Any,\n    images: list[Image],\n    templates: list[str],\n    device: str,\n    extra_processor_kwargs: dict[str, Any],\n) -> dict[str, Any]:\n    \"\"\"Build inputs using the NuExtract-specific template format.\n\n    Requires qwen-vl-utils for vision processing.\n    \"\"\"\n    try:\n        from qwen_vl_utils import process_vision_info\n    except ImportError:\n        raise ImportError(\n            \"qwen-vl-utils is required for NuExtract extraction. \"\n            \"Please install it with: pip install qwen-vl-utils\"\n        )\n\n    inputs = []\n    for pil_img, template in zip(images, templates):\n        inputs.append(\n            {\n                \"document\": {\"type\": \"image\", \"image\": pil_img},\n                \"template\": template,\n            }\n        )\n\n    messages = [[{\"role\": \"user\", \"content\": [x[\"document\"]]}] for x in inputs]\n\n    texts = [\n        processor.tokenizer.apply_chat_template(\n            messages[i],","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/extraction/prompt_utils.py#L8-L44","documentation":"ImportError raised by build_nuextract_inputs in prompt_utils: constructing NuExtract-style vision inputs requires the optional qwen-vl-utils package (process_vision_info), and it is not installed. The message tells you exactly how to install it.","triggerScenarios":"Invoking the NuExtract extraction path that uses prompt_utils.build_nuextract_inputs in an environment where 'from qwen_vl_utils import process_vision_info' raises ImportError.","commonSituations":"Slim installs (docling-slim) or hand-rolled requirements files that omit qwen-vl-utils; production Docker images built from a lockfile that predates the extraction feature.","solutions":["pip install qwen-vl-utils and add it to the deployment's dependency list.","Add an environment check in deployment scripts: ensure 'import qwen_vl_utils' succeeds before starting extraction workers.","If you cannot install it, use an extraction path that does not require NuExtract vision input building."],"exampleFix":"# before\n# requirements.txt: docling-slim only\ninputs = build_nuextract_inputs(...)  # ImportError\n\n# after\n# pip install qwen-vl-utils  (add to requirements.txt)\ninputs = build_nuextract_inputs(...)  # ok","handlingStrategy":"validation","validationCode":"try:\n    import qwen_vl_utils  # noqa: F401\nexcept ImportError:\n    raise SystemExit('pip install qwen-vl-utils before running NuExtract extraction')","typeGuard":null,"tryCatchPattern":"try:\n    inputs = build_nuextract_inputs(images, templates, device, kwargs)\nexcept ImportError as e:\n    if 'qwen-vl-utils' in str(e):\n        raise SystemExit('install qwen-vl-utils to use the NuExtract input builder')\n    raise","preventionTips":["Include qwen-vl-utils in lockfiles for any image-based NuExtract flow.","Fail fast on missing optional deps at worker startup."],"tags":["dependency","import-error","nuextract","extraction"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}