pyufunc.is_module_importable#

pyufunc.is_module_importable(module_name)#

Check whether a module is importable in the current Python environment.

Parameters:

module_name (str) – the module name to import.

Note

This check is performed against the current interpreter (sys.executable), so it reflects the currently activated virtual environment.

Examples

>>> from pyufunc import is_module_importable
>>> is_module_importable("numpy")
True
>>> is_module_importable("unknown_module")
False
Returns:

True if the module is importable, False otherwise.

Return type:

bool