{"record":{"id":"1d4a450e2f9e410f","repo":"BerriAI/litellm","slug":"033-91m-wandb-not-installed-try-running-pip-ins","errorCode":null,"errorMessage":"\\033[91m wandb not installed, try running 'pip install wandb' to fix this error\\033[0m","messagePattern":"\\\\033\\[91m wandb not installed, try running 'pip install wandb' to fix this error\\\\033\\[0m","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/weights_biases.py","lineNumber":179,"sourceCode":"\nexcept Exception:\n    imported_openAIResponse = False\n\n\n#### What this does ####\n#    On success, logs events to Langfuse\nimport traceback\n\n\nclass WeightsBiasesLogger:\n    # Class variables or attributes\n    def __init__(self):\n        try:\n            pass\n        except Exception:\n            raise Exception(\"\\033[91m wandb not installed, try running 'pip install wandb' to fix this error\\033[0m\")\n        if imported_openAIResponse is False:\n            raise Exception(\"\\033[91m wandb not installed, try running 'pip install wandb' to fix this error\\033[0m\")\n        self.resolver = OpenAIRequestResponseResolver()\n\n    def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose):\n        # Method definition\n        import wandb\n\n        try:\n            print_verbose(f\"W&B Logging - Enters logging function for model {kwargs}\")\n            run: Final = wandb.init()\n            print_verbose(response_obj)\n\n            trace: Final = self.resolver(kwargs, response_obj, (end_time - start_time).total_seconds())\n\n            if trace is not None and run is not None:\n                run.log({\"trace\": trace})\n\n            if run is not None:\n                run.finish()","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/weights_biases.py#L161-L197","documentation":"Error \"\\033[91m wandb not installed, try running 'pip install wandb' to fix this error\\033[0m\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/weights_biases.py:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install wandb: pip install wandb."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}