2011年6月1日

Cygwin に pyflakes がきれいに入ったけど emacs で動かない・・・ [失敗]

Cygwin python 2.6 に setuptools を入れる
http://gmt-24.net/archives/723



PyFlakes-Flymake for Python Programming in Emacs
http://www.ymer.org/amir/2010/01/28/pyflakes-flymake-for-python-programming-in-emacs/

を参考にしたが、うまくいかない。

# wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086

--2011-06-01 15:35:58--  http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
XXX.XXX.XXX.XXX:XX に接続しています... 接続しました。
Proxy による接続要求を送信しました、応答を待っています... 200 OK
長さ: 333447 (326K) [application/octet-stream]
`setuptools-0.6c11-py2.6.egg' に保存中

100%[=================================================>] 333,447     --.-K/s 時間 0.08s

2011-06-01 15:35:58 (4.04 MB/s) - `setuptools-0.6c11-py2.6.egg' へ保存完了 [333447/333447]

# sh setuptools-0.6c11-py2.6.egg

Processing setuptools-0.6c11-py2.6.egg
Removing /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to /usr/lib/python2.6/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin
Installing easy_install-2.6 script to /usr/bin

Installed /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11

# easy_install pyflakes

Searching for pyflakes
Best match: pyflakes 0.4.0
Adding pyflakes 0.4.0 to easy-install.pth file

Using /usr/lib/python2.6/site-packages
Processing dependencies for pyflakes
Finished processing dependencies for pyflakes

で、 sample.py を

print "Hello World!

で用意しておき、

# pyflakes sample.py
sample.py:1: EOL while scanning string literal
print "Hello World!
                   ^
とするとちゃんと動いてんだが、 init.el に


;;===== 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)


と書いて、 sample.py を起動しても、

Flymake: Faild to lanch syntax check process 'pyflakes' with args (sample_flymake.py):
     Serching for program: no such file or directory. pyflakes Flymake will be switched OFF

となって、 pyflakes を探せないみたい。

たしかに、 eshell でも、

$ pyflakes sample.py &
pyflakes: command not found

って感じ。なんでー?

0 件のコメント:

コメントを投稿