{"record":{"id":"25e11445eeecb92e","repo":"BerriAI/litellm","slug":"033-91mlangfuse-not-installed-try-running-pip-i-25e114","errorCode":null,"errorMessage":"\\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\\n\\033[0m","messagePattern":"\\\\033\\[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: (.+?)\\\\n\\\\033\\[0m","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/langfuse/langfuse_prompt_management.py","lineNumber":69,"sourceCode":"    Initialize Langfuse client with caching to prevent multiple initializations.\n\n    Args:\n        langfuse_public_key (str, optional): Public key for Langfuse. Defaults to None.\n        langfuse_secret (str, optional): Secret key for Langfuse. Defaults to None.\n        langfuse_host (str, optional): Host URL for Langfuse. Defaults to None.\n        flush_interval (int, optional): Flush interval in seconds. Defaults to 1.\n\n    Returns:\n        Langfuse: Initialized Langfuse client instance\n\n    Raises:\n        Exception: If langfuse package is not installed\n    \"\"\"\n    try:\n        import langfuse\n        from langfuse import Langfuse\n    except Exception as e:\n        raise Exception(\n            f\"\\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\\n\\033[0m\"\n        )\n\n    public_key, secret_key, langfuse_host = resolve_langfuse_credentials(\n        langfuse_public_key=langfuse_public_key,\n        langfuse_secret=langfuse_secret,\n        langfuse_secret_key=langfuse_secret_key,\n        langfuse_host=langfuse_host,\n        allow_env_credentials=allow_env_credentials,\n    )\n\n    if not (langfuse_host.startswith(\"http://\") or langfuse_host.startswith(\"https://\")):\n        # add http:// if unset, assume communicating over private network - e.g. render\n        langfuse_host = \"http://\" + langfuse_host\n\n    langfuse_release: Final = os.getenv(\"LANGFUSE_RELEASE\")\n    langfuse_debug: Final = os.getenv(\"LANGFUSE_DEBUG\")\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/langfuse/langfuse_prompt_management.py#L51-L87","documentation":"Dependency guard in Langfuse prompt management: importing the langfuse package raised ImportError, meaning the optional dependency is not installed in this environment; the message includes the pip command to fix it.","triggerScenarios":"Using Langfuse prompt management without the langfuse package importable.","commonSituations":"Missing optional dependency or a broken langfuse installation.","solutions":["Install langfuse with: pip install langfuse."],"exampleFix":"pip install langfuse","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}