After using macports pip-2.7 to install pyflakes, I can run it manually from the pip installation directory using the command line like:
python /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyflakes myfile.py
However, I'm trying to get my mac emacs environment setup with elpy, and flymake seems to not be able to find pyflakes, giving me a dialog when I open up a python file in elpy mode saying:
Flymake: Failed to launch syntax check process 'pyflakes' (with args myfile.py): Searching for program: no such file or directory, pyflakes. Flymake will be switched off.
I could go into /opt/local/bin and try to write my own executable file that runs the above python command. But that seems hacky and there must be a proper way to install/setup pyflakes such that flymake can find the command without manually creating wrapper scripts, isn't there?
Unless this directory is in your
$PATH, Emacs has no way to know where to findpyflakes.One option would be to create a symbolic link, e.g.
Of course, you will have to use the full path. I shortened it for readability. This is relatively common on Linux machines, though I don't know how broadly it is used on OSX.
Another option, one which I prefer, would be to reinstall
pyflakesusingpip install's--useroption:--useris great for installing things that you might want to run independently of any particular project, likepyflakes. It installs things to your home directory instead of to a system directory, so you don't need any elevated privileges to use it.You may have to add the user location to your
$PATHvariable, but you'll only have to do this once. Any future tools installed usingpip install --userwill become available immediately.On my Linux machine, the directory that I had to add to my
$PATHis~/.local/bin/.