{"record":{"id":"98940c7c0d31bfee","repo":"chroma-core/chroma","slug":"the-tqdm-python-package-is-not-installed-please-i","errorCode":null,"errorMessage":"The tqdm python package is not installed. Please install it with `pip install tqdm`","messagePattern":"The tqdm python package is not installed\\. Please install it with `pip install tqdm`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/utils/embedding_functions/onnx_mini_lm_l6_v2.py","lineNumber":86,"sourceCode":"        try:\n            # Equivalent to import onnxruntime\n            self.ort = importlib.import_module(\"onnxruntime\")\n        except ImportError:\n            raise ValueError(\n                \"The onnxruntime python package is not installed. Please install it with `pip install onnxruntime`\"\n            )\n        try:\n            # Equivalent to from tokenizers import Tokenizer\n            self.Tokenizer = importlib.import_module(\"tokenizers\").Tokenizer\n        except ImportError:\n            raise ValueError(\n                \"The tokenizers python package is not installed. Please install it with `pip install tokenizers`\"\n            )\n        try:\n            # Equivalent to from tqdm import tqdm\n            self.tqdm = importlib.import_module(\"tqdm\").tqdm\n        except ImportError:\n            raise ValueError(\n                \"The tqdm python package is not installed. Please install it with `pip install tqdm`\"\n            )\n\n    # Borrowed from https://gist.github.com/yanqd0/c13ed29e29432e3cf3e7c38467f42f51\n    # Download with tqdm to preserve the sentence-transformers experience\n    @retry(  # type: ignore\n        reraise=True,\n        stop=stop_after_attempt(3),\n        wait=wait_random(min=1, max=3),\n        retry=retry_if_exception(lambda e: \"does not match expected SHA256\" in str(e)),\n    )\n    def _download(self, url: str, fname: str, chunk_size: int = 1024) -> None:\n        \"\"\"\n        Download the onnx model from the URL and save it to the file path.\n\n        Args:\n            url: The URL to download the model from.\n            fname: The path to save the model to.","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/utils/embedding_functions/onnx_mini_lm_l6_v2.py#L68-L104","documentation":"The third lazy import in ONNXMiniLM_L6_V2.__init__ is tqdm (importlib.import_module(\"tqdm\").tqdm); ImportError becomes ValueError with the pip hint. tqdm is only used to render a progress bar while downloading the ONNX model file into ~/.cache/chroma/onnx_models/, but it is unconditionally required at construction, so a missing tqdm fails even before any download starts.","triggerScenarios":"Constructing ONNXMiniLM_L6_V2() where chromadb's default extras were not installed and tqdm is absent; environments that deliberately exclude tqdm (some minimal runners consider it bloat); dependency resolvers dropping tqdm after a conflict.","commonSituations":"Minimal production/CI images that strip dev-niceties like tqdm; Lambdas/serverless builds minimizing package size; fresh venvs created from a hand-maintained requirements list that omits tqdm.","solutions":["pip install tqdm","Or restore the full default dependency set: pip install --force-reinstall chromadb","Add tqdm to your lockfile so it is present in every environment that instantiates this EF"],"exampleFix":"// before\nfn = ONNXMiniLM_L6_V2()  # ValueError: tqdm not installed\n\n// after (shell)\npip install tqdm\n// then\nfn = ONNXMiniLM_L6_V2()","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec(\"tqdm\") is None:\n    raise SystemExit(\"tqdm missing (used for model download progress): pip install tqdm\")\nef = ONNXMiniLM_L6_V2()","typeGuard":null,"tryCatchPattern":"try:\n    ef = ONNXMiniLM_L6_V2()\nexcept ValueError as e:\n    if \"tqdm\" in str(e):\n        raise SystemExit(\"Run: pip install tqdm\") from e\n    raise","preventionTips":["Don't strip tqdm from slim images if the default EF will download its model there","Pre-download the model on a build stage that has tqdm, then ship the ~/.cache/chroma/onnx_models directory"],"tags":["onnx","embedding-function","tqdm","import-error","dependency","chroma"],"backgroundTag":"missing-dependency","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}