{"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/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/weights_biases.py#L161-L197","documentation":"WeightsBiasesLogger init detected wandb is unavailable — either the wandb import failed or the OpenAI-response shim could not be imported (imported_openAIResponse False); the red-highlighted sentinel error names the missing package.","triggerScenarios":"Thrown at litellm/integrations/weights_biases.py:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the wandb package: pip install wandb","If you do not need Weights & Biases logging, remove 'wandb' from litellm.success_callback / litellm.callbacks."],"exampleFix":null,"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-23T08:17:48.524Z"}