State.import_extensions#
- State.import_extensions(ext: str | PathLike | Iterable[str | PathLike] | None = None, append=True) None#
Import extensions and register their locations for multiprocessing.
- Parameters:
- extstr, path-like, or iterable of these
Package paths or Python module names (including dotted names). Relative paths are resolved against this state’s working directory, or the current directory if no working directory is configured. For a single Python file, use the module name without
.py. Absolute import locations are saved so workers can load the same extensions even if their current directory differs from the caller’s.- appendbool, default True
Append to the registered extensions. If false, replace the list. This does not unload previously imported Python modules.