We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13168fe commit 01f11b8Copy full SHA for 01f11b8
nipype/interfaces/base/core.py
@@ -1164,12 +1164,10 @@ class LibraryBaseInterface(BaseInterface):
1164
def __init__(self, check_import=True, *args, **kwargs):
1165
super(LibraryBaseInterface, self).__init__(*args, **kwargs)
1166
if check_import:
1167
- import importlib
+ import pkgutil
1168
failed_imports = []
1169
for pkg in (self._pkg,) + tuple(self.imports):
1170
- try:
1171
- importlib.import_module(pkg)
1172
- except ImportError:
+ if pkgutil.find_loader(pkg) is None:
1173
failed_imports.append(pkg)
1174
if failed_imports:
1175
iflogger.warning('Unable to import %s; %s interface may fail to '
0 commit comments