简体   繁体   English

如何使用 SublimeLinter 解决此问题?

[英]How can I fix this issue with SublimeLinter?

I hope it is ok to ask this even though it is not specifically a programming question.我希望可以问这个问题,即使这不是一个专门的编程问题。 I installed the SublimeLinter and SublimeLinter-flake8 packages in Sublime Text 3. I did pip install flake8 and restarted but the console shows the following message:我在 Sublime Text 3 中安装了SublimeLinterSublimeLinter-flake8包。我做了pip install flake8并重新启动,但控制台显示以下消息:

SublimeLinter: WARNING: cannot locate 'flake8'. SublimeLinter:警告:找不到“flake8”。 Fill in the 'python' or 'executable' setting.填写“python”或“可执行”设置。 WARNING:SublimeLinter.lint.base_linter.python_linter:cannot locate 'flake8'.Fill in the 'python' or 'executable' setting警告:SublimeLinter.lint.base_linter.python_linter:找不到'flake8'。填写'python'或'executable'设置

I suspect it may have to do with setting a path in the user settings, but I am not sure how to go about it.我怀疑这可能与在用户设置中设置路径有关,但我不知道如何 go 关于它。 As you may see I am a relative newbie.如您所见,我是一个相对新手。 Thanks.谢谢。

Please ensure you've followed these steps:请确保您已按照以下步骤操作:

  1. Install SublimeText packages ( help )安装 SublimeText 包(帮助

    • SublimeLinter SublimeLinter
    • SublimeLinter-flake8 SublimeLinter-flake8
  2. Install Flake8 (use pip , or pip3 if you have multiple python versions)安装Flake8 (使用pippip3如果您有多个 python 版本)

    • pip3 install flake8
  3. Configure flake8 settings配置flake8设置
    1. Open Sublime Text打开崇高文本
    2. Sublime Text -> Preferences -> Package Settings -> Sublime Linter -> Settings Sublime Text -> 首选项 -> Package 设置 -> Sublime Linter -> 设置
    3. Set the path to the desired python version:将路径设置为所需的 python 版本:

Notice: Custom settings needs to be on the right(user) side!注意:自定义设置需要在右侧(用户)侧!

{
    "linters": {
        "flake8": {
            "executable": [ "python3", "-m", "flake8" ]
        }
    }
}

Restart Sublime to enable the changes重新启动Sublime 以启用更改

在此处输入图像描述

Not sure about pip or pip3 ?不确定pippip3吗? Please take a look at pip or pip3 to install packages for Python 3?请查看pip 或 pip3 来安装 Python 3 的软件包?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM