Import Helpers¶
Module: polygraphy.mod
-
LATEST_VERSION
= 'latest'¶ Indicates that the latest version of the package is preferred in lazy_import
-
lazy_import
(name, log=True, version=None)[source]¶ Lazily import a module.
If the POLYGRAPHY_AUTOINSTALL_DEPS environment variable is set to 1, missing modules are automatically installed, and existing modules may be upgraded if newer versions are required.
- Parameters
name (str) – The name of the module.
log (bool) – Whether to log information about the module.
version (str) – The preferred version of the package, formatted as a version string. For example,
'>=0.5.0'
or'==1.8.0'
. UseLATEST_VERSION
to indicate that the latest version of the package is preferred.
- Returns
A lazily loaded module. When an attribute is first accessed, the module will be imported.
- Return type
LazyModule