![](/img/trans.png)
[英]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.