linter pylint未安装vscode

Drk*_*Str 6 visual-studio-code vscode-settings

我知道SO上有这个问题的多个版本,我已尝试在这些线程上发布的解决方案,但它们似乎没有帮助:(

我在Ubuntu VM中安装了VS Code.我似乎无法让python linter工作.即我收到一条消息说

Linter pylint is not installed 
Run Code Online (Sandbox Code Playgroud)

我很确定在VM上安装了pylint,因为当我运行时which pylint我有一个有价值的输出.

下面是输出用于which pythonwhich pylint分别

/usr/bin/python
/home/rakshak/.local/bin/pylint
Run Code Online (Sandbox Code Playgroud)

我在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"
}
Run Code Online (Sandbox Code Playgroud)

Drk*_*Str 3

所以,事实证明这只是一个权限问题!

当我收到pylint not installed消息时,我看到一个“安装 pylint”按钮,该按钮运行

须藤 pip 安装 pylint

这将 my 的所有者更改.local/lib/为 root 并使其无法被 vscode 访问。

的输出ls -ld ~/.local/lib/

drwx------ 3 root root 4096 Sep 24 10:49 /home/用户名/.local/lib/

与我的组和用户一起运行 chown 修复了此问题。

sudo chown -R组:用户~/.local

ls -ld ~/.local/lib/现在读取的输出

drwx------ 3 userGroup 用户名4096 九月 24 10:49 /home/rakshak/.local/lib/