简体   繁体   中英

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:

SublimeLinter: WARNING: cannot locate 'flake8'. Fill in the 'python' or 'executable' setting. WARNING:SublimeLinter.lint.base_linter.python_linter:cannot locate 'flake8'.Fill in the 'python' or 'executable' setting

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. As you may see I am a relative newbie. Thanks.

Please ensure you've followed these steps:

  1. Install SublimeText packages ( help )

    • SublimeLinter
    • SublimeLinter-flake8
  2. Install Flake8 (use pip , or pip3 if you have multiple python versions)

    • pip3 install flake8
  3. Configure flake8 settings
    1. Open Sublime Text
    2. Sublime Text -> Preferences -> Package Settings -> Sublime Linter -> Settings
    3. Set the path to the desired python version:

Notice: Custom settings needs to be on the right(user) side!

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

Restart Sublime to enable the changes

在此处输入图像描述

Not sure about pip or pip3 ? Please take a look at pip or pip3 to install packages for Python 3?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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