(class from pyomo.common.dependencies)
pyomo.common.dependencies
Bases: object
object
Mock object that raises DeferredImportError upon attribute access
DeferredImportError
This object is returned by attempt_import() in lieu of the module in the case that the module import fails. Any attempts to access attributes on this object will raise a DeferredImportError exception.
attempt_import()
name (str) – The module name that was being imported
message (str) – The string message to return in the raised exception
version_error (str) – A string to add to the message if the module failed to import because it did not match the required version
import_error (str) – A string to add to the message documenting the Exception raised when the module failed to import.
package (str) – The module name that originally attempted the import
Methods
__init__(name, message, version_error, ...)
__init__
generate_import_warning([logger])
generate_import_warning
DEPRECATED.
log_import_warning([logger, msg])
log_import_warning
Log the import error message to the specified logger
mro()
mro
Return a type's method resolution order.
Member Documentation
Deprecated since version 6.0: use log_import_warning()
log_import_warning()
This will log the the import error message to the specified logger. If msg= is specified, it will override the default message passed to this instance of ModuleUnavailable.
msg=
ModuleUnavailable
Return a type’s method resolution order.