-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Mypy "Linting Output" empty despite regular command reporting errors #7595
Comments
Hi @beeb 👋 Unfortunately, i am not able to reproduce it.
Contents of yo.py
Does it happen with other interpreters as well, with any file content? |
Hey @karrtikr . At the moment it happens with any file content and any of the interpreters I have on my machine (which are all from conda environments). Is there a way to see more in-depth debug logs that could hint at an issue? How could I investigate what happens during that process? Cheers |
Check and paste this mentioned in the issue template, see if you can find any errors.
You could try debugging the extension code if you're really into investigating. This is where the output is being printed |
I on purpose did not include the console output because there was nothing more than in the output tab. Thanks for the hint, I'll try to investigate |
I believe I may be running into the same issue: Using Windows 10 with mypy installed into the workspace's (mini)conda environment, the problems panel shows nothing on source files with type errors. The output panel indicates that I've spent some time tinkering around, and managed to get a traceback out of vscode by replacing
It looks like the mypy module fails to run due to an import error from sqlite3, which is weird since this would indicate something is just wrong with the Python environment. So I thought this was maybe some conda issue, and yes indeed, it was: Essentially, running This is quite surprising to me, I would've thought that using the full path to the conda env's python executable (as VSCode seems to be doing) would just work. Apparently, what is needed is to spawn a shell process, run the conda activate script, and then launch mypy from there. I don't understand Python's import mechanics well enough to understand why this is going on, but maybe the VSCode Python extension should try to run the linters through an activated environment, as well? So possible workarounds are:
|
I'll report back later today, thanks for the in-depth write-up. Hold tight! |
Well guys, it seems today I'm not able to reproduce the bug I had. Mypy is working as expected even without any workaround ¯\(ツ)/¯ |
Alright, I'll close this issue for now, and if anybody encounters it again (and the suggested workarounds don't work) feel free to comment here and I'll reopen it 🙂 |
Thanks @karrtikr but it isn't. I found that issue when I was looking up my problem but it was unrelated to filename, as I used very simple names when testing. |
@kimadeline great to see this is being fixed! @beeb interesting -- possibly I'm facing a different issue than the original 😕 @karrtikr I was also not using any nonstandard names (foo, bar in fact 😄) |
According to https://twitter.com/jeremytwfortune/status/1467866142849081351, it can be caused by multiple layers of |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): Jedi Enabled TrueExpected behaviour
Output from the mypy command is displayed in the OUTPUT tab under the Python dropdown, and the contents is parsed to be shown in the Problems tab
Actual behaviour
OUTPUT tab shows the command being executed (twice actually), but the
Linting Output - mypy
is empty. Copy-pasting the exactmypy
command shown in this tab to a command prompt prints some errors as expected.Yesterday I thought I had solved the problem by completely uninstalling and reinstalling miniconda, creating the virtual env again, which solved the problem for a little while. Now the problem is back. Cannot get mypy to work with either the
base
miniconda env or my custom one.Steps to reproduce:
mypy
throughpip install
orconda install
##########Linting Output - mypy##########
being emptyLogs
This is what the same command outputs if I run it in a separate terminal
The text was updated successfully, but these errors were encountered: