我正在使用Ubuntu 14.04
安装了pylint:
sudo apt-get install pylint
我下载了eclipse luna并在市场上安装了pydev。但是,不是linting我的代码,我的python运行时是linted。
我的控制台输出:
PyLint: Executing command line: /usr/bin/pylint /home/devnull/pyworkspace/soup/test1.py
PyLint: The stdout of the command line is:
PyLint: The stderr of the command line is: File "/usr/lib/python3.4/site.py", line 182
file=sys.stderr)
^
SyntaxError: invalid syntax
我的配置:
知道我配置错了吗? 如果我从终端运行pylint一切正常。
更新来自终端的输出:
No config file found, using default configuration
************* Module test1
C: 14, 0: Line too long (104/80) (line-too-long)
C: 14, 0: Exactly one space required after comma
return "{0}_{1}.html".format(date.today().strftime('%y_%m_%d'), str(uuid.uuid4()).replace('-','_'))
^ (bad-whitespace)
C: 25, 0: Line too long (112/80) (line-too-long)
C: 37, 0: Exactly one space required after comma
with codecs.open(os.path.join(path,filename()),'w',encoding='utf8') as f:
^ (bad-whitespace)
C: 37, 0: Exactly one space required after comma
with codecs.open(os.path.join(path,filename()),'w',encoding='utf8') as f:
^ (bad-whitespace)
C: 37, 0: Exactly one space required after comma
with codecs.open(os.path.join(path,filename()),'w',encoding='utf8') as f:
^ (bad-whitespace)
C: 1, 0: Missing module docstring (missing-docstring)
F: 3, 0: Unable to import 'bs4' (import-error)
F: 10, 0: Unable to import 'selenium' (import-error)
F: 11, 0: Unable to import 'selenium.webdriver.common.keys' (import-error)
C: 13, 0: Missing function docstring (missing-docstring)
C: 16, 0: Invalid constant name "path" (invalid-name)
C: 21, 0: Invalid constant name "driver" (invalid-name)
C: 30, 0: Invalid constant name "content" (invalid-name)
C: 33, 0: Invalid constant name "soup" (invalid-name)
W: 53,-1: String statement has no effect (pointless-string-statement)
W: 11, 0: Unused import Keys (unused-import)
Report
======
24 statements analysed.
Raw metrics
-----------
+----------+-------+------+---------+-----------+
|type |number |% |previous |difference |
+==========+=======+======+=========+===========+
|code |35 |79.55 |35 |= |
+----------+-------+------+---------+-----------+
|docstring |0 |0.00 |0 |= |
+----------+-------+------+---------+-----------+
|comment |1 |2.27 |1 |= |
+----------+-------+------+---------+-----------+
|empty |8 |18.18 |8 |= |
+----------+-------+------+---------+-----------+
**other output omitted **
PyLint --version:
No config file found, using default configuration
pylint 1.1.0,
astroid 1.0.1, common 0.61.0
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2]
我的运行时间:
答案 0 :(得分:1)
我遇到了同样的问题。我有使用
的python 2.7和python 3.4安装的pylintapt-get install pylint
我和你有同样的错误。
然后我说了
apt-get install pylint3
并将pylint可执行文件的位置更新为
/usr/bin/pylint3
它有效。
安装模块时,您需要定位特定的python主版本号。
我必须为numpy和scipy等做同样的事情。