VScode python pylint 报错(2019)解决及绿波浪线去除

本文介绍了如何解决VScode中Python Pylint报错问题,通过安装Code Spell Checker插件和配置用户Pylint设置,成功去除代码中的绿波浪线错误提示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VScode 报一些不必要的错误,我看网上加自己摸索的,解决了我的一些错误
首先在商店下载一个:Code Spell Checker
在这里插入图片描述
然后是打开 用户下的 pylint setting设置,
在这里插入图片描述
里面添加:

"python.linting.pylintArgs":[
        "--disable=no-name-in-module","--disable=import-error",
        "--disable=unused-import","--disable=unused-argument","--disable=missing-docstring",
        "--disable=unused-variable","--disable=wrong-import-order","--disable=ungrouped-imports",
        "--load-plugins",
    ],

如我的:

{
    "workbench.colorTheme": "Quiet Light",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "editor.fontSize": 18,
    "editor.cursorStyle": "underline",
    "workbench.iconTheme": "vscode-icons",
    "editor.renderIndentGuides": false,
    "python.pythonPath": "C:\\py36\\python.exe",
    "cSpell.userWords": [
        
    ],
    "python.linting.pylintArgs":[
        "--disable=no-name-in-module","--disable=import-error",
        "--disable=unused-import","--disable=unused-argument","--disable=missing-docstring",
        "--disable=unused-variable","--disable=wrong-import-order","--disable=ungrouped-imports",
        "--load-plugins",
    ],
    "window.zoomLevel": 0
}

然后 , 打开你的文件,用上面的插件进行排错,
在这里插入图片描述
结果就是绿线消失,
setting的cSpell.userWords中加了一个排错,如我的就变成了:

"cSpell.userWords": [
        "dont"   # 这个就是上面点击的那个单词
    ],

记得保存就OK了
新开一个项目也不会报错了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值