visual-studio-code - 没有安装 linter pylint vscode
问题描述
我知道这个问题有多个版本,我已经尝试过发布在这些线程上的解决方案,但它们似乎没有帮助:(
我在 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”的按钮,它运行
sudo pip install pylint
这将 my 的所有者更改.local/lib/
为 root 并使其无法访问 vscode。
的输出ls -ld ~/.local/lib/
是
drwx------ 3 root root 4096 Sep 24 10:49 /home/ userName /.local/lib/
与我的组和用户一起运行 chown 解决了这个问题。
sudo chown -R group:user ~/.local
现在ls -ld ~/.local/lib/
读取的输出
drwx------ 3 userGroup 用户名4096 Sep 24 10:49 /home/rakshak/.local/lib/
推荐阅读
- python - TypeError:“datetime.date”对象的描述符“strftime”不适用于“NoneType”对象
- javascript - 未捕获的 TypeError:todos.forEach 和 todos.push 不是函数
- xpath - 使用节点名称中包含通配符的查询构建器 API 实施 AEM 搜索
- python - 有什么方法可以缩短具有相似语句但返回不同的属性?
- ios - 以编程方式向 cgpointmake 或 cgpoint 提供参数以从坐标对创建 cgpoint
- python - 带有折线图的破折号下拉菜单
- django - 如何处理 Django 中的空查询?
- netezza - 如何解决 Netezza 数据库的“超出预留(主机):内存不足”问题?
- excel - 运行时错误“1004”:对象“_Global”的方法“范围”失败 Visual Basics
- gtk - 有没有办法设置 GTKTreeViewColumn 的“单元格区域”属性?