Sublime Forum

SublimeLinter: WARNING: cannot locate 'flake8'

#1

I’m using pep8 autoformat (or at least trying to) but all of the sudden there are a two paths missing. I haven’t changed anything on Sublime. I tried deleting and reinstalling the packages but I still get these errors and pep8 is not auto formatting my python code. Any ideas on what I can try?

Blockquote
SublimeLinter: WARNING: cannot locate ‘flake8’. Fill in the ‘python’ or ‘executable’ setting.
SublimeLinter: WARNING: cannot locate ‘pylint’. Fill in the ‘python’ or ‘executable’ setting.

Blockquote

OSError: resource not found
reloading plugin SublimeLinter.lint
reloading plugin SublimeLinter.init
reloading plugin SublimeLinter.active_linters_view
reloading plugin SublimeLinter.busy_indicator_view
reloading plugin SublimeLinter.goto_commands
reloading plugin SublimeLinter.highlight_view
reloading plugin SublimeLinter.lint
reloading plugin SublimeLinter.log_handler
reloading plugin SublimeLinter.message_view
reloading plugin SublimeLinter.panel_view
reloading plugin SublimeLinter.status_bar_view
reloading plugin SublimeLinter.sublime_linter
reloading plugin SublimeLinter-flake8.linter
reloading plugin SublimeLinter-pylint.linter
git: tracking working dir C:\Users\user\OneDrive\Documents\project1\hubble\mcp3008\blackhole
SublimeLinter: WARNING: cannot locate ‘flake8’. Fill in the ‘python’ or ‘executable’ setting.
SublimeLinter: WARNING: cannot locate ‘pylint’. Fill in the ‘python’ or ‘executable’ setting.
Traceback (most recent call last):
File “./python3.3/subprocess.py”, line 1104, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\userg\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\Flake8Lint.py”, line 1164, in
SublimeLinter: WARNING: cannot locate ‘flake8’. Fill in the ‘python’ or ‘executable’ setting.
SublimeLinter: WARNING: cannot locate ‘pylint’. Fill in the ‘python’ or ‘executable’ setting.
lambda: Flake8Lint.async_lint(view, view_settings, quiet=quiet), 0
File “C:\Users\userg\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\Flake8Lint.py”, line 1221, in async_lint
interpreter, linter)
File “C:\Users\userg\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\lint.py”, line 347, in lint_external
startupinfo=startupinfo
File “./python3.3/subprocess.py”, line 819, in init
File “./python3.3/subprocess.py”, line 1110, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

0 Likes

#2

http://www.sublimelinter.com/en/stable/troubleshooting.html

0 Likes

#3

Thanks! I went through the troubleshooting process but it says that linter should be installed and it is.

Should it also show in my $PATH in Windows 10?

DPI mode: per-monitor v2
startup, version: 3207 windows x64 channel: stable
executable: /C/Program Files/Sublime Text 3/sublime_text.exe
working dir: /C/Program Files/Sublime Text 3
packages path: /C/Users/user1/AppData/Roaming/Sublime Text 3/Packages
state path: /C/Users/user1/AppData/Roaming/Sublime Text 3/Local
zip path: /C/Program Files/Sublime Text 3/Packages
zip path: /C/Users/user1/AppData/Roaming/Sublime Text 3/Installed Packages
ignored_packages: [“Vintage”]
pre session restore time: 0.143357
startup time: 0.193357
first paint time: 0.194357
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.detect_indentation
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.55-jsonschema
reloading plugin AutoPEP8.sublautopep8
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin SublimeLinter-annotations.linter
reloading plugin SublimeLinter-flake8.linter
reloading plugin SublimeLinter-luacheck.linter
reloading plugin SublimeLinter-pylint.linter
reloading plugin SublimeLinter.init
reloading plugin SublimeLinter.active_linters_view
reloading plugin SublimeLinter.busy_indicator_view
reloading plugin SublimeLinter.goto_commands
reloading plugin SublimeLinter.highlight_view
reloading plugin SublimeLinter.log_handler
reloading plugin SublimeLinter.message_view
reloading plugin SublimeLinter.panel_view
reloading plugin SublimeLinter.status_bar_view
reloading plugin SublimeLinter.sublime_linter
reloading plugin SummitLinter.linter
SublimeLinter: ERROR: summitlinter: Defining ‘cls.syntax’ has no effect anymore. Use http://www.sublimelinter.com/en/stable/linter_settings.html#selector instead.
SublimeLinter: WARNING: summitlinter: Defining ‘cls.inline_settings’ has no effect. Please cleanup and remove these settings.
SublimeLinter: WARNING: summitlinter: Defining ‘cls.comment_re’ has no effect. Please cleanup and remove these settings.
SublimeLinter: ERROR: summitlinter disabled. ‘selector’ is mandatory in ‘cls.defaults’.
See http://www.sublimelinter.com/en/stable/linter_settings.html#selector
reloading plugin Python Flake8 Lint.color_theme
reloading plugin Python Flake8 Lint.Flake8Lint
reloading plugin Python Flake8 Lint.lint
reloading plugin Python PEP8 Autoformat.pep8_autoformat
Included directory to sys.path : [‘C:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python PEP8 Autoformat\libs’, ‘C:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python PEP8 Autoformat\libs\py33’]
reloading plugin SublimeREPL.init
reloading plugin SublimeREPL.completions
reloading plugin SublimeREPL.lang_integration
reloading plugin SublimeREPL.run_existing_command
reloading plugin SublimeREPL.sublimerepl
reloading plugin SublimeREPL.sublimerepl_build_system_hack
reloading plugin SublimeREPL.text_transfer
plugins loaded
Lint tools versions:

  • Python Flake8 Lint: 2.4.3
  • pep8: 1.7.0
  • flake8: 2.5.2
  • pyflakes: 1.0.0
  • mccabe: 0.4.0
  • pydocstyle: 1.0.0
  • naming: 0.3.3
  • debugger: 1.4.0
  • import-order: 0.6.1

AutoPEP8:
sublime:
version=3207
platform=windows
arch=x64
packages_path=C:\Users\user1\AppData\Roaming\Sublime Text 3\Packages
installed_packages_path=C:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages
plugin:
version=2.1.0
config: {‘file_menu_search_depth’: 3, ‘avoid_new_line_in_select_mode’: False, ‘ignore-local-config’: False, ‘format_on_save’: False, ‘max-line-length’: 79, ‘indent-size’: 4, ‘debug’: False, ‘exclude’: None, ‘syntax_list’: [‘Python’, ‘Python Django’], ‘logfile’: ‘’, ‘select’: ‘’, ‘hang-closing’: False, ‘global-config’: ‘’, ‘ignore’: ‘’}

Traceback (most recent call last):
File “C:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\color_theme.py”, line 127, in generate_color_scheme_async
scheme_text = sublime.load_resource(scheme)
File “C:\Program Files\Sublime Text 3\sublime.py”, line 192, in load_resource
raise IOError(“resource not found”)
OSError: resource not found
Package Control: Skipping automatic upgrade, last run at 2019-08-11 19:51:48, next run at 2019-08-11 20:51:48 or after
git: tracking working dir C:\Users\user1\OneDrive\Documents\RaspberryPi\peddling_rate_sensor\mcp3008\Raspberry-Pi-peddlingbeat-Pulse-Sensor
SublimeLinter: WARNING: cannot locate ‘flake8’. Fill in the ‘python’ or ‘executable’ setting.
SublimeLinter: WARNING: cannot locate ‘pylint’. Fill in the ‘python’ or ‘executable’ setting.

0 Likes

#4

Linter executables should be in PATH env. Either in Windows’ or SublimeLinter’s.

1 Like

#5

I checked my path in the command terminal and I don’t see anything referring to linter

PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Intel\Intel® Management Engine Components\iCLS
C:\Program Files\Intel\Intel® Management Engine Components\iCLS
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
C:\Program Files\dotnet
C:\Program Files\Microsoft SQL Server\130\Tools\Binn
C:\Program Files\PuTTY
C:\WINDOWS\System32\OpenSSH
C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL
C:\Program Files\Intel\Intel® Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT
C:\Program Files\Intel\Intel® Management Engine Components\IPT
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin
C:\Program Files\Git\cmd
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon
C:\Users\user1\AppData\Local\Microsoft\WindowsApps
C:\Program Files (x86)\Atmel\Flip 3.4.7\bin
C:\Program Files\Microsoft VS Code\bin
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon\

I also searched my computer for an executable (*.exe) that has some resemblance of *Lint and I got this:

c:>dir /b/s Lint
c:\Program Files\GIMP 2\32\lib\python2.7\site-packages\html5lib\filters\lint.py
c:\Program Files\GIMP 2\32\lib\python2.7\site-packages\html5lib\filters\lint.pyc
c:\Program Files\GIMP 2\32\lib\python2.7\site-packages\html5lib\filters\lint.pyo
c:\Program Files\Git\usr\share\makepkg\lint_package
c:\Program Files\Git\usr\share\vim\vim80\compiler\csslint.vim
c:\Program Files\Git\usr\share\vim\vim80\compiler\pylint.vim
c:\Program Files\Git\usr\share\vim\vim80\compiler\splint.vim
c:\Program Files\Git\usr\share\vim\vim80\compiler\xmllint.vim
c:\Program Files\Git\usr\share\vim\vim80\syntax\splint.vim
c:\Users\user1\AppData\Local\Sublime Text 3\Cache\SublimeLinter
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-annotations.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-flake8.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-luacheck.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-pylint.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Installed Packages\SummitLinter.sublime-package
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\Flake8Lint.py
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\Flake8Lint.sublime-settings
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\lint.py
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\contrib\flake8_import_order\flake8_linter.py
c:\Users\user1\AppData\Roaming\Sublime Text 3\Packages\Python Flake8 Lint\contrib\flake8_import_order\pylama_linter.py

All the linter files I have are *.py. I don’t see anything with a *.exe

0 Likes

#6

Let me first ask this…

Do you have flake8 and pylint installed as python modules?
Or even more basic, do you have Python installed on you system?

  • If yes, how you confirm they are installed?
  • If no, install them.

From your PATH, I don’t even think Python is installed.

ALL SublimeLinter plugins are just executable callers. They do not ship executables/modules. YOU have to provide those executables.


And note that the problem you asked is about SublimeLinter-flake8 and SublimeLinter-pylint.

Do not mess it up with Python Flake8 Lint, pep8 autoformat or whatever else. They are just not related to SublimeLinter at all.

0 Likes

#7

Hello,

I do not have python installed in my Windows 10 machine. I’ve never needed Python installed in the past to run Sublime or pep8. Is this something new? The reason I asked about flake8 and pylint was because that is the error Sublime is giving me.

SublimeLinter: WARNING: cannot locate ‘flake8’. Fill in the ‘python’ or ‘executable’ setting.

SublimeLinter: WARNING: cannot locate ‘pylint’. Fill in the ‘python’ or ‘executable’ setting.

0 Likes

#8

You don’t need Python installed to run Sublime because it bundles it’s own version in the plugin_host; however that version of Python is exclusively for plugins to use (i.e. you can’t use it to execute arbitrary programs).

Many packages for Sublime interface with external programs and tools, but they don’t pack a version of that tool with them and require you to install the tool externally. Common reasons for that are things like headache reduction (Sublime supports multiple platforms so a package would have to include multiple copies of the tool) as well as safety reasons (if you have to install the tool, you can keep it up to date) among others.

Though it’s possible that some packages include versions of the external tools they’re supposed to execute, generally speaking SublimeLinter and it’s linter plugins don’t fall into that category; they require you to install external linting tools and then tell the linter plugin how to find the tool. In short they’re acting as an interface layer that executes the tool for you and then shows you the results.

The error message you’re seeing above is an example of that; the linter plugin that you’re using wants to execute pylint, but it can’t. The reasons for that would either be that pylint isn’t installed, or it is installed by trying to execute it doesn’t work because Python is missing. Hence you get a message that tells you to double check both of those things.

1 Like

#10

That’s weird. It seems that pep8 autoformat requires you to have it installed by yourself.

0 Likes

#11

I ran Sublime and used pep 8 on another Windows 7 machine I have and it works fine.

startup, version: 2221 windows x64 channel: stable
executable: /C/Program Files/Sublime Text 2/sublime_text.exe
working dir: /C/Windows/system32
packages path: /C/Users/user1/AppData/Roaming/Sublime Text 2/Packages
settings path: /C/Users/user1/AppData/Roaming/Sublime Text 2/Settings
PackageSetup not required
Py_GetProgramName(): sublime_text.exe
Py_GetExecPrefix(): C:\Program Files\Sublime Text 2
Py_GetProgramFullPath(): C:\Program Files\Sublime Text 2\sublime_text.exe
Py_GetPath(): C:\Program Files\Sublime Text 2\python26.zip;C:\Program Files\Sublime Text 2\DLLs;C:\Program Files\Sublime Text 2\lib;C:\Program Files\Sublime Text 2\lib\plat-win;C:\Program Files\Sublime Text 2\lib\lib-tk;C:\Program Files\Sublime Text 2
Py_GetPythonHome(): C:\Program Files\Sublime Text 2
catalogue loaded
found 6 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 4 files for base name Main.sublime-menu
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\00-package_control.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\01-ssl-windows.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\02-bz2.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\02-select-windows.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\CSS\css_completions.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\comment.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\copy_path.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\delete_word.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\detect_indentation.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\duplicate_line.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\echo.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\exec.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\fold.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\font.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\goto_line.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\indentation.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\kill_ring.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\mark.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\new_templates.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\open_file_settings.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\open_in_browser.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\paragraph.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\save_on_focus_lost.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\scroll.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\set_unsaved_view_name.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\side_bar.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\sort.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\swap_line.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\switch_file.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\transform.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\transpose.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Default\trim_trailing_white_space.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Diff\diff.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\HTML\encode_html_entities.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\HTML\html_completions.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Package Control\1_reloader.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Package Control\2_bootstrap.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Package Control\Package Control.py
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Python PEP8 Autoformat\pep8_autoformat.py
(‘Included directory to sys.path :’, [‘C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Python PEP8 Autoformat\libs’, ‘C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\Python PEP8 Autoformat\libs\py26’])
Reloading plugin C:\Users\user1\AppData\Roaming\Sublime Text 2\Packages\SublimeLinter\SublimeLinter.py
imported capp_lint
imported pep8
imported pyflakes
imported pyflakes.api
imported pyflakes.checker
imported pyflakes.messages
imported pyflakes.reporter
SublimeLinter: C loaded
SublimeLinter: CoffeeScript loaded
SublimeLinter: CSS loaded
SublimeLinter: c_cpplint loaded
SublimeLinter: Git Commit Message loaded
SublimeLinter: Ruby Haml loaded
SublimeLinter: haskell loaded
SublimeLinter: HTML loaded
SublimeLinter: Java loaded
SublimeLinter: JavaScript loaded
SublimeLinter: Lua loaded
SublimeLinter: Annotations loaded
SublimeLinter: Objective-J loaded
SublimeLinter: Perl loaded
SublimeLinter: PHP loaded
SublimeLinter: puppet-lint loaded
SublimeLinter: Puppet loaded
SublimeLinter: Python loaded
SublimeLinter: ruby-lint loaded
SublimeLinter: Ruby loaded
SublimeLinter: Squirrel loaded
SublimeLinter: pylint loaded
SublimeLinter: XML loaded
plugin init time: 0.658403
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
pre session restore time: 0.914362
startup cache, total files: 102 cache hits: 102
startup time: 0.972555 (package setup was not run)
loaded 847 snippets
Package Control: No updated packages
SublimeLinter: python enabled (built in)

0 Likes

#12

That machine is using Sublime Text 2 but your original post references Sublime Text 3; the information as presented above is for Sublime Text 3. In particular the versions of Python that are used in Sublime Text 2 are different between the two and the plugin API is a bit different as well, so any package that works for both versions will have two different versions of itself that may behave differently from each other as a result.

0 Likes

#13

I think @OdatNurd have explained in SublimeLinter: WARNING: cannot locate 'flake8' quite well. You either install Python and the executable/module, or find a plugin with a bundled python modules.

0 Likes