diff --git a/monai/data/image_writer.py b/monai/data/image_writer.py index 5b47a5e6e5..e0726db4fa 100644 --- a/monai/data/image_writer.py +++ b/monai/data/image_writer.py @@ -116,7 +116,12 @@ def resolve_writer(ext_name, error_if_not_found=True) -> Sequence: except Exception: # other writer init errors indicating it exists avail_writers.append(_writer) if not avail_writers and error_if_not_found: - raise OptionalImportError(f"No ImageWriter backend found for {fmt}.") + _supported = ", ".join(sorted(k for k in SUPPORTED_WRITERS.keys() if k != "*")) + raise OptionalImportError( + f"No ImageWriter backend found for {fmt}. " + f"Supported formats: {_supported}. " + f"Please install a suitable package such as 'nibabel', 'itk', or 'Pillow'." + ) writer_tuple = ensure_tuple(avail_writers) SUPPORTED_WRITERS[fmt] = writer_tuple return writer_tuple