BioSimSpace._Utils._try_import¶
- BioSimSpace._Utils._try_import(name: str, install_command: str = None)[source]¶
Try to import the module called ‘name’ and return the resulting module. If this fails, catch the error and instead return a _ModuleStub.
- Parameters:
name (str) – The name of the module being stubbed
install_command (str (optional)) – The command used to install the module. If this is not supplied, then it is assumed to be ‘conda install {name}’
- Returns:
module – The module if it loaded correctly, else otherwise a _ModuleStub for that module
- Return type:
_ModuleStub | module