我知道这个问题有多个版本,我已经尝试了在这些线程上发布的解决方案,但它们似乎无济于事:(
我在Ubuntu VM中安装了VS Code。我似乎无法使python linter正常工作。即我收到一条消息说
Linter pylint is not installed
我很确定pylint已安装在VM上,因为当我运行
which pylint
时,我得到了一个标称输出。这分别是
which python
和which pylint
的输出/usr/bin/python
/home/rakshak/.local/bin/pylint
我在VS Code中的用户设置和工作区设置中具有以下内容
// Place your settings in this file to overwrite the default settings
{
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": "/home/rakshak/.local/bin/pylint",
"python.pythonPath": "/usr/bin/python"
}
最佳答案
因此,事实证明这只是一个权限问题!
当我收到pylint not installed
消息时,系统向我显示一个“安装pylint”按钮
这将我的.local/lib/
的所有者更改为root,并使vscode无法访问。ls -ld ~/.local/lib/
的输出为
与我的小组和用户一起运行chown可以解决此问题。
现在ls -ld ~/.local/lib/
的输出为