1

When Jupyter VSCode extension is removed - the python linting works fine for my notebooks. If some variable or import is defined but never used - there is a warning about that. But without this extension, I can't select the kernel and run the notebook. As soon as I install the extension, the linting goes crazy and shows warnings about "not accessed" variables for all variables and imports accessed in other cells.

enter image description here

Is there a way to disable Jypyter extension own linting or fix this issue? I couldn't find any VSCode setting that would allow me to do that.

Serhiy
  • 4,357
  • 5
  • 37
  • 53
  • It works correctly in my jupyter. Once "Path" is quoted, it will not be warned, and there is no relevant settings about jupyter notebook in my settings.json. You can try to use the preview version extension. Or you can submit it to github, this may be a bug. – MingJie-MSFT Jun 29 '22 at 02:15

1 Answers1

0

Even after disabling every single linting-related VSCode setting, there were still wrong linting errors shown in my notebooks. Googling on how to disable python linting completely led me to this SO answer suggesting changing the python.languageServer to None. For some reason, it was set to Pylance in my settings. Setting it to None did solve the issue for jupyter notebooks. Enabling the linting back didn't cause any problems and linting now works properly for both python files and jupyter notebooks.

TLDR, this is what helped in my case:

"python.languageServer": "None"

Now I can enable linting and it works properly:

"python.linting.enabled": true,
"python.linting.flake8Enabled": true
Serhiy
  • 4,357
  • 5
  • 37
  • 53