I've installed flake8 for flycheck to use to check my python syntax. I installed flake8 in cygwin, using the python interpreter shipped with cygwin, which results in a flake8 file in C:\cygwin64\bin. The problem is, emacs seems to only respect exe files so if I (executable-find "flake8") it yields nil. I had the same problem when I enabled anaconda-mode, since cygwin has python2.7.exe and python in C:\cygwin64\bin. I solved this by copy python2.7.exe to python.exe, but the flake8 problem can't be solved this way.

I vim /usr/bin/flake8d, turns out it's really flake.py with python code inside to run with python.

tl;dr: Generally the question is: How to make emacs aware of "excutables" that would normally run by python flake8.py, node eslint.js? (When I used eslint with flycheck for js-file syntax check, it just works, maybe there's the solution?)

Thanks in advance.

  • It was long ago since I last used Cygwin, but I don't think this is the reason. executable-find uses its own "database" of locations to look at for executables. I believe the variable is exec-path. Look at its current value. If it doesn't contain C:\cygwin64\bin, append-to-list it.
    – wvxvw
    Oct 13, 2016 at 13:30
  • @wvxvw Checked, "C:/cygwin64/bin" is present.
    – JJPandari
    Oct 14, 2016 at 2:19
  • @wvxvw I solved it myself with some luck, you may want to check it out.
    – JJPandari
    Oct 14, 2016 at 7:39
  • Aha, I see. Yes, this would totally make sense.
    – wvxvw
    Oct 14, 2016 at 8:23

1 Answer 1


Solution: cp path/to/eslint.cmd /usr/bin/flake8.cmd, then vim flake8.cmd, edit exe and script names inside.

How I found that: I gave a second thought to "why eslint just works?" Because it's eslint.js? I changed flake8 to flake8.py, no luck. Thanks to everything, I typed eslint. in the search bar, and eslint.cmd stood out. Then I cloned it to flake8.cmd and problem's solved. I tried in both cygwin and dos terminals, flake8 can be invoked just like a command/exe. So I guess for everyone under Windows, the definition for "executable" is the same: .exes and .cmds (and some others).

  • 1
    The list of "others" is in exec-suffixes.
    – npostavs
    Oct 14, 2016 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.