Fix AttributeError: 'module' object has no attribute 'error'