# MarkItDown ImportError and AttributeError

> ImportError: cannot import name MarkItDown usually means a file of yours is called markitdown.py. How to confirm and fix it; the magika error is not reproduced.

Source: https://markitdown.dev/errors/import-error/ · Updated 2026-11-16·Upstream source ↗

If Python says it cannot import `MarkItDown` from `markitdown`, the usual cause is not a broken install: a file of your own is named `markitdown.py`, so Python imports that instead of the library. We reproduced it on three Python versions.

> **Short answer**
>
> Run `python -c "import markitdown; print(markitdown.__file__)"`. If the path is in your own project folder, rename that file and delete its `__pycache__` folder.

Tested with markitdown 0.1.9 · Python 3.10, 3.12 and 3.13 · markitdown 0.1.9 · Linux lab (T08) · 2026-11-16 · evidence: [errors.json](https://markitdown.dev/data/errors.json), [errors-index.csv](https://markitdown.dev/data/errors-index.csv)

## ImportError: cannot import name 'MarkItDown'

Reproduced by us

### ImportError: cannot import name 'MarkItDown' from partially initialized module 'markitdown' (most likely due to a circular import)

Your own file is called markitdown.py (or sits in a folder called markitdown), so Python imports it instead of the library. The wording depends on the Python version: 3.10 to 3.12 say 'partially initialized module', 3.13 and later suggest renaming the file.

Fix

-   Rename the file (and delete its \_\_pycache\_\_ folder), then run again.
-   Check where Python found the module: python -c "import markitdown; print(markitdown.\_\_file\_\_)"

Affected: any · last reproduced 2026-11-15 · [Upstream report](https://github.com/microsoft/markitdown/issues/8)

The wording depends on the Python version: 3.10 to 3.12 say "partially initialized module", and 3.13 and later suggest renaming the file. The same happens with a folder called `markitdown` next to your script.

## AttributeError: 'Magika' object has no attribute 'identify\_stream'

Reported, not reproduced by us

### AttributeError: 'Magika' object has no attribute 'identify\_stream'. Did you mean: 'identify\_bytes'?

An old magika from another package manager is being imported by a newer markitdown.

Fix

-   Install markitdown into a clean venv with pip so magika matches the version markitdown asks for.

Affected: mixed old magika · [Upstream report](https://github.com/microsoft/markitdown/issues/1202)

This one is reported upstream, and **we could not reproduce it**: we forced an old magika (0.5.1) into a 0.1.9 environment and conversion still worked. The cause given upstream is a mismatched magika from another package manager, and a clean virtual environment is the suggested fix, but we have not verified it.

## `command not found` is a different problem

If the shell cannot find the `markitdown` command at all, see [the command-not-found page](https://markitdown.dev/errors/command-not-found/). If a file type needs an extra, see [missing dependency](https://markitdown.dev/errors/missing-dependency/).

## Related

- [markitdown is not recognized / command not found](https://markitdown.dev/errors/command-not-found/): When the command itself is not found.
- [Error reference](https://markitdown.dev/errors/): Every other error message.
- [MissingDependencyException, FileConversionException, UnsupportedFormatException](https://markitdown.dev/errors/missing-dependency/): MissingDependencyException.
- [Install MarkItDown](https://markitdown.dev/install/): Install it cleanly.

---
Independent guide to the open-source MarkItDown library. Not affiliated with or endorsed by Microsoft. Official source: https://github.com/microsoft/markitdown
