jina.importer.import_classes(namespace, show_import_table=False, import_once=False)[source]

Import all or selected executors into the runtime. This is called when Jina is first imported for registering the YAML constructor beforehand. It can be also used to import third-part or external executors.

  • namespace (str) – the namespace to import

  • show_import_table (bool) – show the import result as a table

  • import_once (bool) – import everything only once, to avoid repeated import


the dependency tree of the imported classes under the namespace

class jina.importer.ImportExtensions(required, logger=None, help_text=None, pkg_name=None, verbose=True)[source]

Bases: object

A context manager for wrapping extension import and fallback. It guides the user to pip install correct package by looking up extra-requirements.txt.

  • required (bool) – set to True if you want to raise the ModuleNotFound error

  • logger – when not given, built-in warnings.warn will be used

  • help_text (Optional[str]) – the help text followed after

  • pkg_name (Optional[str]) – the package name to find in extra_requirements.txt, when not given the ModuleNotFound exec_val will be used as the best guess

class jina.importer.PathImporter[source]

Bases: object

The class to import modules from paths.

static add_modules(*paths)[source]

Import modules from paths.


paths – Paths of the modules.

Return type



The target module.