1

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.
Thanks!

pip-setup:

$ pip freeze | grep mypy
flake8-mypy==17.8.0
mypy==0.790
mypy-extensions==0.4.3

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

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.

3
  • Is there anyway to disable the warning message? or prevent it to pop-up on the minibuffer – alper Nov 25 '20 at 20:27
  • You could fix the error found by mypy. Otherwise, look in the flycheck documentation. – db48x Nov 25 '20 at 21:48
  • seems like removing __init__.py file solved the warning message – alper Dec 6 '20 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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