On this page
  1. importlib.import_module
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

importlib.import_module

Up: importlib | Next: importlib.invalidate_caches
Rel: importlib.invalidate_caches, importlib.reload
Ref: docs.python.org — importlib.import_module
Tags: #public #python3 #stdlib #importlib


Import

import importlib
from importlib import import_module

Signature & Overview

importlib.import_module(name, package=None)

Import a module.

Usage

import importlib

math_mod = importlib.import_module("math")
assert math_mod.sqrt(16) == 4.0

Gotchas

REPL Inspect

from importlib import import_module
help(import_module)

Linked from

Related notes