On this page
pkgutil.get_importer
Prev: pkgutil.get_data | Up: pkgutil | Next: pkgutil.iter_importers
Rel: pkgutil.extend_path, pkgutil.get_data, pkgutil.iter_importers, pkgutil.iter_modules
Ref: docs.python.org — pkgutil.get_importer
Tags: #public #python3 #stdlib #pkgutil
Import
import pkgutil
from pkgutil import get_importer
Signature & Overview
pkgutil.get_importer(path_item)
Retrieve a finder for the given path item The returned finder is cached in sys.path_importer_cache if it was newly created by a path hook.
Usage
import pkgutil
imp = pkgutil.get_importer(".")
assert imp is not None
Gotchas
- Returns the
sys.path_importer_cachefinder for a directory or zip path.
REPL Inspect
from pkgutil import get_importer
help(get_importer)
Linked from
- tuts/python3/stdlib_module/pkgutil
- tuts/python3/stdlib_module/pkgutil/extend_path
- tuts/python3/stdlib_module/pkgutil/get_data
- tuts/python3/stdlib_module/pkgutil/iter_importers
- tuts/python3/stdlib_module/pkgutil/iter_modules
- tuts/python3/stdlib_module/pkgutil/ModuleInfo
- tuts/python3/stdlib_module/pkgutil/read_code
- tuts/python3/stdlib_module/pkgutil/walk_packages
Related notes
- tuts/python3/stdlib_module/pkgutil/extend_path Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/get_data Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/iter_importers Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/iter_modules Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/pkgutil/ModuleInfo links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/read_code links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/walk_packages links to this page; shared tags: #pkgutil, #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib