Python logo

Table of Contents

  • importlib — The implementation of import
    • Introduction
    • Functions
    • importlib.abc – Abstract base classes related to import
    • importlib.machinery – Importers and path hooks
    • importlib.util – Utility code for importers
    • Examples
      • Importing programmatically
      • Checking if a module can be imported
      • Importing a source file directly
      • Implementing lazy imports
      • Setting up an importer
      • Approximating importlib.import_module()

Previous topic

runpy — Locating and executing Python modules

Next topic

importlib.resources – Package resource reading, opening and access