{"record":{"id":"fc1cc49a42e5446a","repo":"run-llama/llama_index","slug":"opik-handler-is-not-installed-please-install-it-u","errorCode":null,"errorMessage":"Opik Handler is not installed. Please install it using `pip install llama-index-callbacks-opik`","messagePattern":"Opik Handler is not installed\\. Please install it using `pip install llama-index-callbacks-opik`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/callbacks/global_handlers.py","lineNumber":141,"sourceCode":"        AgentOpsHandler.init(**eval_params)\n    elif eval_mode == \"literalai\":\n        try:\n            from llama_index.callbacks.literalai import (\n                literalai_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"Literal AI Handler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-literalai`\"\n            )\n        handler = literalai_callback_handler(**eval_params)\n    elif eval_mode == \"opik\":\n        try:\n            from llama_index.callbacks.opik import (\n                opik_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"Opik Handler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-opik`\"\n            )\n        handler = opik_callback_handler(**eval_params)\n    else:\n        raise ValueError(f\"Eval mode {eval_mode} not supported.\")\n\n    return handler\n","sourceCodeStart":123,"sourceCodeEnd":150,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/callbacks/global_handlers.py#L123-L150","documentation":"Raised by create_global_handler() when eval_mode is 'opik' but llama-index-callbacks-opik is missing. Opik (Comet) tracing is an optional integration; the lazy import of opik_callback_handler is wrapped in try/except ImportError and re-raised with the install hint.","triggerScenarios":"create_global_handler('opik', ...) or set_global_handler('opik') without the package; `from llama_index.callbacks.opik import opik_callback_handler` raises ImportError.","commonSituations":"Adding Opik evaluation/tracing after following Comet docs in a minimal env; installing the opik SDK without the LlamaIndex bridge; stale lockfiles after integrations were split out.","solutions":["pip install llama-index-callbacks-opik","Verify: python -c \"from llama_index.callbacks.opik import opik_callback_handler\"","Configure OPIK API credentials/endpoint if you keep tracing enabled","Remove the opik eval mode if unused"],"exampleFix":"# before\nset_global_handler('opik')  # ImportError\n\n# after\n# pip install llama-index-callbacks-opik\nset_global_handler('opik')","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('llama_index.callbacks.opik') is None:\n    raise SystemExit('pip install llama-index-callbacks-opik')","typeGuard":null,"tryCatchPattern":"try:\n    handler = create_global_handler('opik')\nexcept ImportError as e:\n    handler = None","preventionTips":["Add a startup assertion for every optional integration your config enables","Keep tracing configuration data-driven so modes can be disabled without code changes"],"tags":["llama-index","callbacks","import-error","optional-dependency","opik"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}