3

Spyder 中的编辑器总是在我输入该行后立即给我未使用的导入/变量的警告。我想禁止此类警告。我怎么做?而且我希望我在 Spyder 编辑器中打开的每个文件都发生这种情况,而不喜欢本地修复。

我尝试在其中添加'disable =',~/.pylintrc但没有奏效。此外,Spyder 编辑器无论如何都使用 pyflakes。

4

4 回答 4

2

你需要去

Tools > Preferences > Editor > Code Introspection/Analysis

并停用名为

Real-time code analysis

于 2017-10-04T21:43:46.783 回答
0
import warnings
warnings.filterwarnings("ignore")
于 2021-11-28T12:19:34.130 回答
0

在 Spyder 中使用了linter pyflakes。您可以在行尾写一个特殊的注释来忽略该行。以下评论有效:

from mpl_toolkits.mplot3d import Axes3D  # noqa
from mpl_toolkits.mplot3d import Axes3D  # analysis:ignore
于 2021-12-15T16:41:22.070 回答
-1

找到首选项 -> 编辑器 -> 代码自省/分析 -> 停用/取消选中实时代码分析 警告:它也将停止在编辑器中显示错误

于 2019-04-01T06:48:41.160 回答