In python 3.6.2 I am trying to import a module with importlib. I am able to import the module directly as:
from scripts import config_A_2
but when trying with importlib as follows
module = importlib.import_module('config_A_2', 'scripts')
I get an error
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'config_A_2'
Maybe I am using importlib in a wrong way?
Info: Its a Mac...