linter-pycodestyle
linter-pycodestyle copied to clipboard
Unable to run pycodestyle on MacOS when installed inside pyenv environment.
It seems that even if I point in the config the shim path to pycodestyle, atom fails to run it.
Config /Users/ssbarnea/.pyenv/shims/pycodestyle
-- running command from CLI works without problems, but Atom:
[Linter] Error running pycodestyle Error: pyenv: pycodestyle: command not found
The `pycodestyle' command exists in these Python versions:
2.7.14
at ChildProcess.<anonymous> (/Users/ssbarnea/.atom/packages/linter-jshint/node_modules/sb-exec/lib/index.js:56)
at emitTwo (events.js:106)
at ChildProcess.emit (events.js:191)
at maybeClose (internal/child_process.js:885)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226)
I do have other python based linters also installed in default pyenv environment and they seem to be working. I wonder what prevents it from working in this case.
I even tried other workarounds that are supposed to work like installing pycodestyle at userlevel using system python, checked that /usr/bin/python -m pycodestyle
works , but when I put the same command on linter-pycodestyle it still fails:
Error running pycodestyle Error: Failed to spawn command `/usr/bin/python -m pycodestyle`. Make sure `/usr/bin/python -m pycodestyle` is installed and on your PATH
at /Users/ssbarnea/.atom/packages/linter-jshint/node_modules/atom-linter/lib/helpers.js:130
at process._tickCallback (internal/process/next_tick.js:103)
I think that the new error is caused by the fact that it does not expect a command with arguments. Calling modules directly is one common solution to avoid the need to install executables in PATH. Still, if the spawner doesn't have a clue that the command contains arguments, it fails to start the process with an error like above.