BerriAI/litellm · error · ModuleNotFoundError

Missing dependency {e}. Run `pip install 'litellm[proxy]'`

Error message

Missing dependency {e}. Run `pip install 'litellm[proxy]'`

What it means

Import guard when starting the proxy server in non-local mode: importing proxy_server failed with ModuleNotFoundError, meaning optional proxy dependencies are absent from the environment. The missing module is named in the message and the fix is installing the proxy extra.

Source

Thrown at litellm/proxy/proxy_cli.py:1012

    args: Final = locals()
    if local:
        from proxy_server import (
            KeyManagementSettings,
            ProxyConfig,
            app,
            save_worker_config,
        )
    else:
        try:
            from .proxy_server import (
                KeyManagementSettings,
                ProxyConfig,
                app,
                save_worker_config,
            )
        except ModuleNotFoundError as e:
            raise ModuleNotFoundError(f"Missing dependency {e}. Run `pip install 'litellm[proxy]'`")
        except ImportError as e:
            if "litellm[proxy]" in str(e):
                # user is missing a proxy dependency, ask them to pip install litellm[proxy]
                raise e
            else:
                # this is just a local/relative import error, user git cloned litellm
                from proxy_server import (
                    KeyManagementSettings,
                    ProxyConfig,
                    app,
                    save_worker_config,
                )
    if version is True:
        ProxyInitializationHelpers._echo_litellm_version()
        return
    if model and "ollama" in model and api_base is None:
        ProxyInitializationHelpers._run_ollama_serve()
    if health is True:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Install proxy dependencies: pip install 'litellm[proxy]', then restart.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/proxy_cli.py:1012 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/b3a5e232f297cea4. Report an issue: GitHub.