Вот же описание:
importlib.import_module(name, package=None)
Import a module. The name argument specifies what module to import in absolute or relative terms (e.g. either pkg.mod or ..mod). If the name is specified in relative terms, then the package argument must be set to the name of the package which is to act as the anchor for resolving the package name (e.g. import_module('..mod', 'pkg.subpkg') will import pkg.mod).
The import_module() function acts as a simplifying wrapper around importlib.__import__(). This means all semantics of the function are derived from importlib.__import__(), including requiring the package from which an import is occurring to have been previously imported (i.e., package must already be imported). The most important difference is that import_module() returns the most nested package or module that was imported (e.g. pkg.mod), while __import__() returns the top-level package or module (e.g. pkg).
Вот обычнейший код:
>>>from importlib import import_module >>>mod = import_module('D:\SCRIPTS\OTHERS\pers_dict.py') Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Python33\lib\importlib\__init__.py", line 88, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1577, in _gcd_import File "<frozen importlib._bootstrap>", line 1558, in _find_and_load File "<frozen importlib._bootstrap>", line 1505, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1577, in _gcd_import File "<frozen importlib._bootstrap>", line 1558, in _find_and_load File "<frozen importlib._bootstrap>", line 1522, in _find_and_load_unlocked ImportError: No module named 'D:\\SCRIPTS\\OTHERS\\pers_dict'
Помогите одолеть проблему. Что не так делаю?