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[source]¶

Dynamically imports a module and raises a helpful exception if the module is not installed.

Parameters
  • module_name (str) –

  • pip_name (Optional[str]) –

  • package (Optional[str]) –

Return type

Any