On Saturday 25 September 2010, it occurred to Dsrt Egle to exclaim: > Thanks for your reply, Ben. Actually I have the paths "C:\Python25;C: > \Python25\Scripts" in the %PATH% variable, and the %PYTHONPATH% has > the following: > > [...] > > Looking at the file C:\Python25\Lib\site-packages\pyflakes-0.4.0- > py2.5.egg\EGG-INFO\scripts\pyflakes, it shows >
C:\Python25\Lib\site-packages\pyflakes-0.4.0-py2.5.egg\EGG-INFO\scripts\ doesn't appear to be on your PATH then? Also, the file "pyflakes" won't be executable without a file extension on Windows. I suggest you try either creating a pyflakes.bat file somewhere on your PATH, or using the pyflakes script as pyflakes.py, locates somewhere on the PATH (will this work? I'm not sure) > > #!C:\Python25\python.exe > > from pyflakes.scripts.pyflakes import main > main() > > > So this script needs to trigger Python interpreter to run. I can > successfully run pyflakes by manually triggering Python like this: > > C:\>python C:\Python25\Lib\site-packages\pyflakes-0.4.0-py2.5.egg\EGG- > INFO\scripts\pyflakes test_new_lib.py > test_new_lib.py:13: invalid syntax > sa.CoreObj. > > > > So pyflakes is running correctly. But it seems Emacs treats pyflakes > as an executable program instead of Python script. I include the > following in my .emacs file for pyflakes: > > > > ;;===== PyFlakes > ;; code checking via pyflakes+flymake > > (when (load "flymake" t) > (defun flymake-pyflakes-init () > (let* ((temp-file (flymake-init-create-temp-buffer-copy > 'flymake-create-temp-inplace)) > (local-file (file-relative-name > temp-file > (file-name-directory buffer-file-name)))) > (list "pyflakes" (list local-file)))) > > (add-to-list 'flymake-allowed-file-name-masks > '("\\.py\\'" flymake-pyflakes-init))) > > (add-hook 'find-file-hook 'flymake-find-file-hook) > > > > What should I do to configure Emacs to make pyflakes working? Thank > you! -- http://mail.python.org/mailman/listinfo/python-list