我刚刚从源代码安装了pylint,并且在从emacs中调用时无法使用epylint。从命令行调用它时工作正常。
在我的.emacs文件中,我已经定义了一个' pylint'功能如下:
(defun pylint ()
(interactive)
(compile (concat "epylint " buffer-file-name)))
当我从emacs中运行M-x pylint
时,出现以下错误:
-*- mode: compilation; default-directory: "~/projects/external/pylearn2/pylearn2/scripts/papers/maxout/tests/" -*-
Compilation started at Sun Sep 14 15:54:49
epylint /home/mkg/projects/external/pylearn2/pylearn2/scripts/papers/maxout/tests/test_model.py
Warning: option include-ids is deprecated and ignored.
Warning: option symbols is deprecated and ignored.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 1085, in
Run(sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 1025, in __init__
linter.check(args)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 608, in check
self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 685, in check_astroid_module
walker.walk(astroid)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 847, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 844, in walk
cb(astroid)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/typecheck.py", line 282, in visit_getattr
confidence=confidence)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/__init__.py", line 97, in add_message
self.linter.add_message(msg_id, line, node, args, confidence)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 401, in add_message
(path, module, obj, line or 1, col_offset or 0), msg, confidence))
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/reporters/text.py", line 61, in handle_message
self.write_message(msg)
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/reporters/text.py", line 51, in write_message
self.writeln(msg.format(self._template))
File "/usr/local/lib/python2.7/dist-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 105, in format
return template.format(**dict(zip(self._fields, self)))
KeyError: u'path'
************* Module test_model
Compilation exited abnormally with code 1 at Sun Sep 14 15:54:53
对于那些好奇的人:我不再使用Ubuntu的pylint包了,因为Ubuntu 13.10的pylint已经过时,但仍然包含一个bug,这使得它无法与numpy一起使用
我们非常感谢任何建议。