{"record":{"id":"1a20d8419b249431","repo":"BerriAI/litellm","slug":"033-91mlangfuse-not-installed-try-running-pip-i","errorCode":null,"errorMessage":"\\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\\n{traceback.format_exc()}\\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.py","lineNumber":134,"sourceCode":"\n    return public_key, secret_key, resolved_host\n\n\nclass LangFuseLogger:\n    # Class variables or attributes\n    def __init__(\n        self,\n        langfuse_public_key=None,\n        langfuse_secret=None,\n        langfuse_host=None,\n        flush_interval=1,\n        allow_env_credentials: bool = True,\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{traceback.format_exc()}\\033[0m\"\n            )\n        self.public_key, self.secret_key, self.langfuse_host = resolve_langfuse_credentials(\n            langfuse_public_key=langfuse_public_key,\n            langfuse_secret=langfuse_secret,\n            langfuse_host=langfuse_host,\n            allow_env_credentials=allow_env_credentials,\n        )\n        if not (self.langfuse_host.startswith(\"http://\") or self.langfuse_host.startswith(\"https://\")):\n            # add http:// if unset, assume communicating over private network - e.g. render\n            self.langfuse_host = \"http://\" + self.langfuse_host\n        self.langfuse_release = os.getenv(\"LANGFUSE_RELEASE\")\n        self.langfuse_debug = os.getenv(\"LANGFUSE_DEBUG\")\n        self.langfuse_flush_interval = LangFuseLogger._get_langfuse_flush_interval(flush_interval)\n\n        if should_use_langfuse_mock():\n            self.langfuse_client = create_mock_langfuse_client()\n            self.is_mock_mode = True","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/langfuse/langfuse.py#L116-L152","documentation":"LangFuseLogger.__init__ failed while importing the langfuse package (original exception and traceback interpolated into the red-highlighted message); the logger cannot start without the SDK installed.","triggerScenarios":"Enabling the langfuse callback without the langfuse package installed.","commonSituations":"Optional dependency not installed in the environment or an incompatible langfuse major version.","solutions":["Install langfuse with: pip install langfuse.","Check the traceback in the message for the underlying import failure."],"exampleFix":"pip install 'langfuse>=2.0.0'","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"}