{"record":{"id":"0ba642323d5c5b54","repo":"run-llama/llama_index","slug":"langfusecallbackhandler-is-not-installed-please-i","errorCode":null,"errorMessage":"LangfuseCallbackHandler is not installed. Please install it using `pip install llama-index-callbacks-langfuse`","messagePattern":"LangfuseCallbackHandler is not installed\\. Please install it using `pip install llama-index-callbacks-langfuse`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/callbacks/global_handlers.py","lineNumber":108,"sourceCode":"        handler = SimpleLLMHandler(**eval_params)\n    elif eval_mode == \"argilla\":\n        try:\n            from llama_index.callbacks.argilla import (\n                argilla_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"ArgillaCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-argilla`\"\n            )\n        handler = argilla_callback_handler(**eval_params)\n    elif eval_mode == \"langfuse\":\n        try:\n            from llama_index.callbacks.langfuse import (\n                langfuse_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"LangfuseCallbackHandler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-langfuse`\"\n            )\n        handler = langfuse_callback_handler(**eval_params)\n    elif eval_mode == \"agentops\":\n        try:\n            from llama_index.callbacks.agentops import (\n                AgentOpsHandler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"AgentOpsHandler is not installed. \"\n                \"Please install it using `pip install llama-index-instrumentation-agentops`\"\n            )\n        AgentOpsHandler.init(**eval_params)\n    elif eval_mode == \"literalai\":\n        try:\n            from llama_index.callbacks.literalai import (","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/callbacks/global_handlers.py#L90-L126","documentation":"Raised by create_global_handler() when eval_mode is 'langfuse' but llama-index-callbacks-langfuse is missing. The Langfuse tracing integration is optional and imported only when selected; ImportError is re-raised with the exact package name to install.","triggerScenarios":"create_global_handler('langfuse', ...) / set_global_handler('langfuse') without the wheel; `from llama_index.callbacks.langfuse import langfuse_callback_handler` raises ImportError inside the try block.","commonSituations":"Enabling Langfuse observability in apps deployed from slim base images; pip install langfuse alone does not provide the LlamaIndex integration; version mismatch after upgrading llama-index-core.","solutions":["pip install llama-index-callbacks-langfuse","Verify: python -c \"from llama_index.callbacks.langfuse import langfuse_callback_handler\"","Set LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY env vars for tracing","Disable the langfuse eval mode if not needed"],"exampleFix":"# before\nset_global_handler('langfuse')  # ImportError\n\n# after\n# pip install llama-index-callbacks-langfuse\nset_global_handler('langfuse')","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('llama_index.callbacks.langfuse') is None:\n    raise SystemExit('pip install llama-index-callbacks-langfuse')","typeGuard":null,"tryCatchPattern":"try:\n    handler = create_global_handler('langfuse')\nexcept ImportError as e:\n    logger.warning('Langfuse off: %s', e)\n    handler = None","preventionTips":["Note that `pip install langfuse` does not install the LlamaIndex bridge","List tracing extras in pyproject.toml optional-dependencies"],"tags":["llama-index","callbacks","import-error","optional-dependency","langfuse"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}