[英]VS Code : Linter Pylint Not Installed; pip install pylint not working
[英]“Linter pylint is not installed” every time I start VS Code
每次我启动 VS Code 时,都会弹出一个带有红十字的小 window 说“Linter pylint 未安装”,其中包含三个Install
选项, Select Linter
或Do not show again
。 但是,当我单击Install
时,它会在/usr/bin/python
上打开集成终端并告诉我“要求已经满足,正在跳过升级”。 当我点击Select linter
pylint
时,我可以在列表末尾找到 select pylint。 which pylint
返回“找不到 pylint”。 这让我发疯。 它最近才开始出现这种行为不端,但我不确定是什么原因造成的。 我已经尝试了这个线程中的所有答案Linter pylint is not installed和这个线程Getting error message "Linter pylint is not installed"但没有任何变化。 pip3 install pylint
返回“要求已经满足”。 我需要一些帮助。
这些是我的 linting 设置:
"python.pythonPath": "/usr/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": "python -m pylint",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=pygame",
"--errors-only"
],```
在 VS Code window 的左下角,它告诉您编辑器当前正在使用哪个 python 环境来评估/运行您的代码。 (这只会在您在编辑器中打开 Python 文件后出现。)您可以单击它进行更改。
您需要确保 pylint 是 pip 安装在您选择的相同环境中。 这可能是问题所在!
编辑:在我的settings.json
,我没有"python.pythonPath": "/usr/bin/python"
。 如果它与您选择的 Python 环境不同,可能会导致问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.