I keep having following warning message, even I have the recent version of python-mypy not sure why this warning message is generated; is there any way to fix this:

Suspicious state from syntax checker python-mypy: Flycheck checker python-mypy returned 2, but its output contained no errors:
utils.py: error: Source file found twice under different module names: 'Program.utils' and 'utils'
Found 1 error in 1 file (checked 1 source file)

Try installing a more recent version of python-mypy, and please open a bug report if the issue persists in the latest release.


$ pip freeze | grep mypy

output of elpy-config within the emacs:

Elpy Configuration

Emacs.............: 26.3
Elpy..............: 1.34.0
Virtualenv........: venv (/home/alper/venv)
Interactive Python: python3 3.7.5 (/home/alper/venv/bin/python3)
RPC virtualenv....: rpc-venv (/home/alper/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.7.5 (/home/alper/.emacs.d/elpy/rpc-venv/bin/python)
 Jedi.............: 0.17.2
 Rope.............: 0.16.0
 Autopep8.........: 1.5.4
 Yapf.............: 0.30.0
 Black............: 20.8b1
Syntax checker....: flake8 (/home/alper/venv/bin/flake8)

1 Answer 1


You're getting this message because Flycheck ran mypy to see if your code was correct and while mypy returned an error code, it didn't print out a list of errors (at least not as far as Flycheck could tell.)

The error message includes the output from mypy:

utils.py: error: Source file found twice under different module names: 'Program.utils' and 'utils'
Found 1 error in 1 file (checked 1 source file)

A human might interpret this as an error message, I suppose, but it doesn't match any of the regular expressions that Flycheck uses to look for errors. You could update those regular expressions yourself, or even file a bug asking the Flycheck developers to fix it.

  • Is there anyway to disable the warning message? or prevent it to pop-up on the minibuffer
    – alper
    Commented Nov 25, 2020 at 20:27
  • You could fix the error found by mypy. Otherwise, look in the flycheck documentation.
    – db48x
    Commented Nov 25, 2020 at 21:48
  • 1
    seems like removing __init__.py file solved the warning message
    – alper
    Commented Dec 6, 2020 at 23:52
  • For me it was the opposite : adding a (missing) __init__.py in the file's folder.
    – Hettomei
    Commented Nov 18, 2022 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.