BerriAI/litellm · error · Exception
\033[91m wandb not installed, try running 'pip install…
Error message
\033[91m wandb not installed, try running 'pip install wandb' to fix this error\033[0m
What it means
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.
Solutions
- Install the wandb package: pip install wandb
- If you do not need Weights & Biases logging, remove 'wandb' from litellm.success_callback / litellm.callbacks.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/integrations/weights_biases.py:179 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/1d4a450e2f9e410f.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/integrations/weights_biases.py:179
except Exception:
imported_openAIResponse = False
#### What this does ####
# On success, logs events to Langfuse
import traceback
class WeightsBiasesLogger:
# Class variables or attributes
def __init__(self):
try:
pass
except Exception:
raise Exception("\033[91m wandb not installed, try running 'pip install wandb' to fix this error\033[0m")
if imported_openAIResponse is False:
raise Exception("\033[91m wandb not installed, try running 'pip install wandb' to fix this error\033[0m")
self.resolver = OpenAIRequestResponseResolver()
def log_event(self, kwargs, response_obj, start_time, end_time, print_verbose):
# Method definition
import wandb
try:
print_verbose(f"W&B Logging - Enters logging function for model {kwargs}")
run: Final = wandb.init()
print_verbose(response_obj)
trace: Final = self.resolver(kwargs, response_obj, (end_time - start_time).total_seconds())
if trace is not None and run is not None:
run.log({"trace": trace})
if run is not None:
run.finish()View on GitHub (pinned to 77b7c6c40c)