Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xxx is not a valid Python package name #95

Open
long2ice opened this issue Mar 1, 2022 · 5 comments
Open

xxx is not a valid Python package name #95

long2ice opened this issue Mar 1, 2022 · 5 comments

Comments

@long2ice
Copy link

long2ice commented Mar 1, 2022

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

image

@intgr
Copy link
Collaborator

intgr commented Mar 1, 2022

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

See python/mypy#8400 python/mypy#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.

@long2ice
Copy link
Author

long2ice commented Mar 1, 2022

OK, thanks for you reply

@intgr
Copy link
Collaborator

intgr commented Mar 1, 2022

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.

@Andrioden
Copy link

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

@zhukovgreen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants