mypy-pycharm icon indicating copy to clipboard operation
mypy-pycharm copied to clipboard

xxx is not a valid Python package name

Open long2ice opened this issue 3 years ago • 5 comments

After upgrade to 0.4.0, there is a error occur, but is right before

image

long2ice avatar Mar 01 '22 02:03 long2ice

This error message is verbatim from mypy. Previous plugin versions simply ignored these errors, but they are reported since 0.14.0.

See https://github.com/python/mypy/issues/8400 https://github.com/python/mypy/issues/10515, looks like you need to change __init__.py files in your project. Maybe --namespace-packages flag also affects this behavior, I am not sure.

intgr avatar Mar 01 '22 07:03 intgr

OK, thanks for you reply

long2ice avatar Mar 01 '22 07:03 long2ice

Did this solve the problem you had? It's possible that the real issue you are having is #95. I haven't yet looked into it in depth though.

intgr avatar Mar 01 '22 21:03 intgr

Having the same problem, no idea what csi-015 is. The most annoying part is that i get these error popups.

Cant find any files/paths with csi in it either: ls -a -R | grep csi

Running mypy . and dmypy run . works just fine.

My suggestion is that you @intgr either print more output in the error as I have no idea what is failing, or hide the warnings.


07.04.2022
00:51	Mypy Plugin (Mypy exited abnormally): csi-015 is not a valid Python package name

00:51	Unexpected Exception Caught
			The scan failed due to an exception: Mypy failed with code 2
			com.leinardi.pycharm.mypy.exception.MypyToolException: Mypy failed with code 2
			at com.leinardi.pycharm.mypy.mpapi.MypyRunner.runMypy(MypyRunner.java:324)
			at com.leinardi.pycharm.mypy.mpapi.MypyRunner.scan(MypyRunner.java:260)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.scan(ScanFiles.java:109)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.checkFiles(ScanFiles.java:100)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.call(ScanFiles.java:74)
			at com.leinardi.pycharm.mypy.MypyAnnotator.doAnnotate(MypyAnnotator.java:131)
			at com.leinardi.pycharm.mypy.MypyAnnotator.doAnnotate(MypyAnnotator.java:62)
			at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
			at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:212)
			... (show balloon)

00:51	Mypy Plugin (Mypy exited abnormally): csi-017 is not a valid Python package name

00:51	Unexpected Exception Caught
			The scan failed due to an exception: Mypy failed with code 2
			com.leinardi.pycharm.mypy.exception.MypyToolException: Mypy failed with code 2
			at com.leinardi.pycharm.mypy.mpapi.MypyRunner.runMypy(MypyRunner.java:324)
			at com.leinardi.pycharm.mypy.mpapi.MypyRunner.scan(MypyRunner.java:260)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.scan(ScanFiles.java:109)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.checkFiles(ScanFiles.java:100)
			at com.leinardi.pycharm.mypy.checker.ScanFiles.call(ScanFiles.java:74)
			at com.leinardi.pycharm.mypy.MypyAnnotator.doAnnotate(MypyAnnotator.java:131)
			at com.leinardi.pycharm.mypy.MypyAnnotator.doAnnotate(MypyAnnotator.java:62)
			at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
			at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:212)
			... (show balloon)

image

Andrioden avatar Apr 06 '22 23:04 Andrioden

In my case the problem was solved, when I rm -frv .mypy_cache

zhukovgreen avatar Jan 26 '23 20:01 zhukovgreen