Failed to spawn command pep8 when file is open from Finder, works from shell


#1

When i open a python file with Atom by double-cliking on it, it tells an error:
"Failed to spawn command pep8. Make sure pep8 is installed and on your PATH"
and precisely

 Uncaught BufferedProcessError: Failed to spawn command `pep8`. Make sure `pep8` is installed and on your PATH
/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:100 Uncaught BufferedProcessError: Failed to spawn command `pep8`. Make sure `pep8` is installed and on your PATH/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:100 (anonymous function)events.js:107 emitchild_process.js:1066 ChildProcess._handle.onexitchild_process.js:1138 (anonymous function)node.js:386 _tickCallback

if i open the file from terminal, everything works.

any idea? it’s probably something with environments or variable that atom cannot load in the first case.


#2

This is an issue with OS X. Applications inherit a different environment depending on whether they are started from a shell or from an icon. See:


#3

it works only if i open from terminal, which is not a solution since i use mostly atom to open file via finder.
is there a solution? the other topic was closed saying that it was solved but “starting atom from shell” every time is not a solution for me.


#4

Yes, if you read the Stack Overflow topic that was linked in the other topic, it has a solution that does not include “starting atom from shell” every time. I’ll link it here again:

Once again, there is nothing Atom can do about this. This is the way that OS X works. Please read the Stack Overflow issue for the solution.