microsoft/markitdown · error · MissingDependencyException

{converter} recognized the input as a potential {extension}

Error message

{converter} recognized the input as a potential {extension} file, but the dependencies needed to read {extension} files have not been installed. To resolve this error, include the optional dependency [{feature}] or [all] when installing MarkItDown. For example:

* pip install 'markitdown[{feature}]'
* pip install 'markitdown[all]'
* pip install 'markitdown[{feature}, ...]'
* etc.

What it means

MarkItDown's OutlookMsgConverter raises MissingDependencyException when convert() runs but the import of its .msg parsing library (extract-msg) failed at module load. The stream was accepted as a potential .msg file (extension or outlook mimetype sniffing), yet the runtime lacks the 'outlook' optional extra. The module-level try/except captures the ImportError so the error surfaces only at conversion time, not import time.

Source

Thrown at packages/markitdown/src/markitdown/converters/_outlook_msg_converter.py:81

                    "__properties_version1.0" in toc
                    and "__recip_version1.0_#00000000" in toc
                )
        except Exception as e:
            pass
        finally:
            file_stream.seek(cur_pos)

        return False

    def convert(
        self,
        file_stream: BinaryIO,
        stream_info: StreamInfo,
        **kwargs: Any,  # Options to pass to the converter
    ) -> DocumentConverterResult:
        # Check: the dependencies
        if _dependency_exc_info is not None:
            raise MissingDependencyException(
                MISSING_DEPENDENCY_MESSAGE.format(
                    converter=type(self).__name__,
                    extension=".msg",
                    feature="outlook",
                )
            ) from _dependency_exc_info[
                1
            ].with_traceback(  # type: ignore[union-attr]
                _dependency_exc_info[2]
            )

        assert (
            olefile is not None
        )  # If we made it this far, olefile should be available
        msg = olefile.OleFileIO(file_stream)

        # Extract email metadata
        md_content = "# Email Message\n\n"

View on GitHub (pinned to fd239d5d2b)

Solutions

  1. Install the outlook extra: pip install 'markitdown[outlook]'
  2. Or install everything: pip install 'markitdown[all]'
  3. Verify the underlying import works: python -c "import extract_msg"; reinstall if it fails
  4. Declare markitdown[outlook] in your application's requirements so the extra is never omitted in deployments

Example fix

# before
pip install markitdown
markitdown email.msg  # MissingDependencyException

# after
pip install 'markitdown[outlook]'
markitdown email.msg
Defensive patterns

Strategy: try-catch

Validate before calling

from markitdown.converters._outlook_msg_converter import _dependency_exc_info

def can_convert_msg() -> bool:
    return _dependency_exc_info is None

Try / catch

from markitdown import MarkItDown, MissingDependencyException

try:
    result = MarkItDown().convert("email.msg")
except MissingDependencyException:
    logger.error("install markitdown[outlook] to process .msg files")
    raise

Prevention

When it happens

Trigger: Calling convert() on a stream with extension .msg (or content matching the msg sniff in accepts()) when markitdown was installed without the [outlook] extra; or when extract-msg is present but fails to import due to broken dependencies (it needs olefile and others).

Common situations: Base `pip install markitdown` in a service that later receives .msg attachments; automated email-ingestion pipelines assuming all formats work out of the box; pip dependency resolution silently removing extract-msg during an upgrade.

Related errors


AI-assisted analysis of microsoft/markitdown@fd239d5d2b (2026-08-14). Data as JSON: /api/errors/99765f2be98c87d1. Report an issue: GitHub.