{"record":{"id":"d992d44e89cfab99","repo":"docling-project/docling","slug":"qwen-vl-utils-is-required-for-nuextracttransformer","errorCode":null,"errorMessage":"qwen-vl-utils is required for NuExtractTransformersModel. Please install it with: pip install qwen-vl-utils","messagePattern":"qwen-vl-utils is required for NuExtractTransformersModel\\. Please install it with: pip install qwen-vl-utils","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"docling/models/extraction/nuextract_transformers_model.py","lineNumber":44,"sourceCode":"# Source code from https://huggingface.co/numind/NuExtract-2.0-8B\ndef process_all_vision_info(messages, examples=None):\n    \"\"\"\n    Process vision information from both messages and in-context examples, supporting batch processing.\n\n    Args:\n        messages: List of message dictionaries (single input) OR list of message lists (batch input)\n        examples: Optional list of example dictionaries (single input) OR list of example lists (batch)\n\n    Returns:\n        A flat list of all images in the correct order:\n        - For single input: example images followed by message images\n        - For batch input: interleaved as (item1 examples, item1 input, item2 examples, item2 input, etc.)\n        - Returns None if no images were found\n    \"\"\"\n    try:\n        from qwen_vl_utils import fetch_image, process_vision_info\n    except ImportError:\n        raise ImportError(\n            \"qwen-vl-utils is required for NuExtractTransformersModel. \"\n            \"Please install it with: pip install qwen-vl-utils\"\n        )\n\n    from qwen_vl_utils import fetch_image, process_vision_info\n\n    # Helper function to extract images from examples\n    def extract_example_images(example_item):\n        if not example_item:\n            return []\n\n        # Handle both list of examples and single example\n        examples_to_process = (\n            example_item if isinstance(example_item, list) else [example_item]\n        )\n        images = []\n\n        for example in examples_to_process:","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/extraction/nuextract_transformers_model.py#L26-L62","documentation":"ImportError raised by the image-collection helper in NuExtractTransformersModel: processing vision inputs for the NuExtract model needs the optional qwen-vl-utils package, which is not installed in the current environment.","triggerScenarios":"Running NuExtract extraction with the transformers backend (NuExtractTransformersModel) in an environment where 'import qwen_vl_utils' fails; the helper catches ImportError and re-raises with install instructions.","commonSituations":"Installing docling-slim or a minimal requirements set without the extraction extras; fresh venv/CI image that only lists core dependencies.","solutions":["Install the missing package: pip install qwen-vl-utils (or add it to your requirements/pyproject).","Install the Docling extra that bundles extraction dependencies if one is provided (e.g. docling[vlm]-style extras).","Verify with 'python -c \"import qwen_vl_utils\"' before launching a batch job."],"exampleFix":"# before\n# pip install docling-slim  (no qwen-vl-utils)\nmodel = NuExtractTransformersModel(...)\nmodel(...)  # ImportError\n\n# after\n# pip install qwen-vl-utils\nmodel = NuExtractTransformersModel(...)\nmodel(...)  # ok","handlingStrategy":"validation","validationCode":"try:\n    import qwen_vl_utils  # noqa: F401\nexcept ImportError:\n    raise SystemExit('pip install qwen-vl-utils before using NuExtractTransformersModel')","typeGuard":null,"tryCatchPattern":"try:\n    result = model(inputs)\nexcept ImportError as e:\n    if 'qwen-vl-utils' in str(e):\n        raise SystemExit('install qwen-vl-utils and restart the worker')\n    raise","preventionTips":["Add qwen-vl-utils to the deployment requirements when using NuExtract with transformers.","Smoke-test optional imports during service startup, not mid-batch."],"tags":["dependency","import-error","nuextract","extraction"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}