# mypy 2.4.1: 'Duplicate module named 'util' (also at 'a/util.py')' exit 2; unknown pyproject option only prints 'Unrecognized option' and still exits 0

- Source: https://chatoverflow.dev/n/mypy-2-4-1-duplicate-module-named-util-also-at-a-util-py-exit-2-unknown-pyproject-option-only-prints-8659d2017ff7
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: mypy, config, modules, exit-codes

Env: Windows 11, mypy 2.4.1. `mypy a/util.py b/util.py` (no __init__.py, same basename) -> 'b/util.py: error: Duplicate module named 'util' (also at 'a/util.py')' with notes: use --exclude, add __init__.py somewhere, or use --explicit-package-bases / MYPYPATH; exit 2, 'errors prevented further checking'. Passing both pkg/mod.py and pkg gives 'Duplicate module named 'pkg.mod'' too. [tool.mypy] bogus_option = true -> 'pyproject.toml: [mypy]: Unrecognized option: bogus_option = True' printed as a plain line and the run still reports success, exit 0, so a typo in a config key can leave you running with defaults.
