{"record":{"id":"4c3eb0355626e5c9","repo":"run-llama/llama_index","slug":"wandbcallbackhandler-is-not-installed-please-inst","errorCode":null,"errorMessage":"WandbCallbackHandler is not installed. Please install it using `pip install llama-index-callbacks-wandb`","messagePattern":"WandbCallbackHandler is not installed\\. Please install it using `pip install llama-index-callbacks-wandb`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/callbacks/global_handlers.py","lineNumber":26,"sourceCode":"    import llama_index.core\n\n    handler = create_global_handler(eval_mode, **eval_params)\n    if handler:\n        llama_index.core.global_handler = handler\n\n\ndef create_global_handler(\n    eval_mode: str, **eval_params: Any\n) -> Optional[BaseCallbackHandler]:\n    \"\"\"Get global eval handler.\"\"\"\n    handler: Optional[BaseCallbackHandler] = None\n    if eval_mode == \"wandb\":\n        try:\n            from llama_index.callbacks.wandb import (\n                WandbCallbackHandler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"WandbCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-wandb`\"\n            )\n\n        handler = WandbCallbackHandler(**eval_params)\n    elif eval_mode == \"openinference\":\n        try:\n            from llama_index.callbacks.openinference import (\n                OpenInferenceCallbackHandler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"OpenInferenceCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-openinference`\"\n            )\n\n        handler = OpenInferenceCallbackHandler(**eval_params)\n    elif eval_mode == \"arize_phoenix\":","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/callbacks/global_handlers.py#L8-L44","documentation":"Raised by create_global_handler() when global_handlers eval_mode is 'wandb' but the optional integration package llama-index-callbacks-wandb is not installed. llama-index-core keeps every observability integration as a separate optional dependency and lazily imports it only when that eval mode is selected, so a missing wheel surfaces as this ImportError at handler-creation time. The message names the exact pip package to install.","triggerScenarios":"Setting global eval mode to wandb, e.g. Settings.callback_manager.global_handler = create_global_handler('wandb', project='x') or llama_index.core.set_global_handler('wandb'), in an environment where `pip show llama-index-callbacks-wandb` fails. The `from llama_index.callbacks.wandb import WandbCallbackHandler` import inside the try block raises ImportError and is re-raised with this message.","commonSituations":"Installing only llama-index-core (or the meta-package without extras) and then enabling W&B tracing; CI environments that trimmed optional deps; typo'd extras like pip install llama-index[wandb] on distributions that publish a separate callbacks wheel; upgrading llama-index and forgetting that integrations moved to independently versioned packages.","solutions":["pip install llama-index-callbacks-wandb","Verify the import works: python -c \"from llama_index.callbacks.wandb import WandbCallbackHandler\"","Pin the integration version compatible with your llama-index-core version in requirements.txt","If you did not intend W&B tracing, remove the 'wandb' eval_mode / set_global_handler call"],"exampleFix":"# before\nfrom llama_index.core import set_global_handler\nset_global_handler('wandb', project='my-project')  # ImportError\n\n# after\n# pip install llama-index-callbacks-wandb\nfrom llama_index.core import set_global_handler\nset_global_handler('wandb', project='my-project')","handlingStrategy":"validation","validationCode":"import importlib.util\nwandb_available = importlib.util.find_spec('llama_index.callbacks.wandb') is not None\nif not wandb_available:\n    raise SystemExit('Install it: pip install llama-index-callbacks-wandb')","typeGuard":null,"tryCatchPattern":"try:\n    handler = create_global_handler('wandb', project='x')\nexcept ImportError as e:\n    logger.warning('W&B tracing disabled: %s', e)\n    handler = None","preventionTips":["Declare every observability integration you enable in requirements.txt alongside llama-index-core","Run a startup import smoke test for each optional integration before setting the global handler","Gate eval-mode handlers behind config so tracing can be disabled in minimal environments"],"tags":["llama-index","callbacks","import-error","optional-dependency","wandb"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}