Toggle Menu
Prev Up Next

# `langchain_core.utils.utils`.guard_import

langchain_core.utils.utils.guard_import(module_name: str, *, pip_name: Optional[str] = None, package: Optional[str] = None) → Any

  Dynamically import a module and raise an exception if the module is not installed.

  Parameters

    - module_name (str) –

    - pip_name (Optional[str]) –

    - package (Optional[str]) –

  Return type

    Any