3

The editor in Spyder always gives me warnings for unused imports/variables immediately after I type the line. I want to suppress such warnings. How do I do that? And I want this to happen for every file I open in the Spyder editor, wouldn't prefer local fixes.

I tried adding 'disable=' in ~/.pylintrc and it didn't work. Moreover, the Spyder editor uses pyflakes anyway.

HMK
  • 578
  • 2
  • 9
  • 24

4 Answers4

2

You need to go to

Tools > Preferences > Editor > Code Introspection/Analysis

and deactivate the option called

Real-time code analysis

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
0
import warnings
warnings.filterwarnings("ignore")
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
0

In Spyder the linter pyflakes is used. You can write a special comment at the end of the line to ignore the line. The following comments work:

from mpl_toolkits.mplot3d import Axes3D  # noqa
from mpl_toolkits.mplot3d import Axes3D  # analysis:ignore
John
  • 1,472
  • 1
  • 19
  • 22
-3

locate preferences -> Editor -> Code Introspection/Analysis -> Deactivate/Uncheck the Real time code analysis Warning: It will also stop showing errors in the editor

agrek11
  • 1
  • 1
  • 2