Python logo

上一主题

codeop --- Compile Python code

下一主题

zipimport --- Import modules from Zip archives

本页

  • Report a Bug
  • 显示源代码

导航

  • 索引
  • 模块 |
  • 下一页 |
  • 上一页 |
  • Python logo
  • Python »
  • 3.12.11 Documentation »
  • The Python Standard Library »
  • Importing Modules
  • |
  • |

Importing Modules¶

The modules described in this chapter provide new ways to import other Python modules and hooks for customizing the import process.

The full list of modules described in this chapter is:

  • zipimport --- Import modules from Zip archives
    • zipimporter Objects
    • Examples
  • pkgutil --- Package extension utility
  • modulefinder --- Find modules used by a script
    • Example usage of ModuleFinder
  • runpy --- Locating and executing Python modules
  • 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()
  • importlib.resources -- Package resource reading, opening and access
    • Functional API
  • importlib.resources.abc -- Abstract base classes for resources
  • importlib.metadata -- Accessing package metadata
    • Overview
    • Functional API
      • Entry points
      • Distribution metadata
      • Distribution versions
      • Distribution files
      • Distribution requirements
      • Mapping import to distribution packages
    • Distributions
    • Distribution Discovery
    • Extending the search algorithm
  • The initialization of the sys.path module search path
    • Virtual environments
    • _pth files
    • Embedded Python

上一主题

codeop --- Compile Python code

下一主题

zipimport --- Import modules from Zip archives

本页

  • Report a Bug
  • 显示源代码
«

导航

  • 索引
  • 模块 |
  • 下一页 |
  • 上一页 |
  • Python logo
  • Python »
  • 3.12.11 Documentation »
  • The Python Standard Library »
  • Importing Modules
  • |
  • |
© 版权 2001-2025, Python Software Foundation.
本页面采用 Python 软件基金会许可证第 2 版授权。
文档中的示例、代码片段及其他代码内容额外采用零条款 BSD 许可证授权。
更多信息请参阅《 历史与许可 》。

Python 软件基金会是一家非营利性公司。 请进行捐赠。

最后更新于10月 08, 2025 (08:20 UTC) 。 发现了错误?
使用Sphinx 8.2.3 创建。