【问题标题】:How to check whether Pylint setup is OK如何检查 Pylint 设置是否正常
【发布时间】:2021-03-31 03:19:02
【问题描述】:

如何检查 Pylint 是否在 Visual Studio Code 中成功安装和配置?

我已经设置了“Python:启用 linting”,但它似乎不起作用。我在下面的 problem 字段中运行了代码。有人可以解释以下问题字段中发生了什么吗?

Enter image description here

Enter image description here

【问题讨论】:

  • 你使用的是全局环境吗?
  • 你能裁剪和缩小这些图像(为使它们内联做准备)吗?即只包含实际需要的部分。

标签: python visual-studio-code pylint linter


【解决方案1】:
  1. 检查Pylint是否安装成功:

    作为一个Python代码分析工具包,Pylint作为Pylint模块存储在Python环境中,所以我们可以在Visual Studio Code终端中使用“pip show pylint”来检查它的安装情况:

  2. Pylint 在 Visual Studio Code 中的使用

    1. 安装 Pylint (pip install pylint)。

    2. 选择皮林特。

    3. 启用 Pylint。

    4. 运行(F1Python: Run Linting

参考:Linting in Visual Studio Code

【讨论】:

  • pip3 show pylint 在 Ubuntu 上(在Ubuntu MATE 20.04(Focal Fossa)上尝试过)-“pip3”,而不是“pip”。 pip show pylint 导致 "Command 'pip' not found,但有 18 个类似的。"(包括在 Visual Studio Code 环境中)。
猜你喜欢
  • 2018-07-29
  • 2013-08-10
  • 2016-02-07
  • 2011-04-08
  • 2016-12-05
  • 1970-01-01
  • 1970-01-01
  • 2015-07-25
  • 1970-01-01
相关资源
最近更新 更多