【问题标题】:Using linter from WSL (Ubuntu for Windows) in Visual Studio Code在 Visual Studio Code 中使用来自 WSL (Ubuntu for Windows) 的 linter
【发布时间】:2017-12-01 15:51:11
【问题描述】:

我正在 VS Code 中设置 Python 环境,并且已经安装了the plugin

VSCode 提示无法运行 pylint:

但是,pylint 安装在我的本地 WSL 中(尽管不是在 Windows 上)。如果我单击Install Pylint 按钮,VSCode 中嵌入的 WSL 终端显示如下:

$ python -m pip install pylint
Requirement already satisfied: pylint in /home/mao/anaconda3/lib/python3.6/site-packages

如何让 VS Code 使用这个已安装的 pylint?

【问题讨论】:

    标签: python windows visual-studio-code pylint windows-subsystem-for-linux


    【解决方案1】:

    确保您为工作区选择的 Python 解释器与您想要安装 Pylint 的解释器相匹配(如果您正在运行最新版本的扩展程序,您可以在下方的状态栏中看到它指定的-窗口左侧)。您还可以将python.pylint.pylintPath setting 设置为显式指向pylint 命令位置。

    请注意,至少从 0.8.0 版开始,Python 扩展中没有对 WSL 的官方支持(虽然它是 planned)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-17
      • 2016-12-31
      • 1970-01-01
      • 2020-03-15
      • 1970-01-01
      • 1970-01-01
      • 2021-07-30
      相关资源
      最近更新 更多