python - Eclipse 中的 PyLint,步骤 linting python 运行时

标签 python eclipse pylint

我正在使用 Ubuntu 14.04

安装的 pylint 有:

sudo apt-get install pylint

我在市场上下载了 eclipse luna 并安装了 pydev。但不是对我的代码进行 lint,而是对我的 python 运行时进行了 lint。

我的控制台输出:

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 eclipse

知道我配置错了什么吗? 如果我从终端运行 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]

我的运行时:

myruntime

最佳答案

我刚遇到同样的问题。我使用 python 2.7 和 python 3.4 安装了 pylint

apt-get install pylint

我遇到了和你一样的错误。

然后我安装了

apt-get install pylint3

并将pylint可执行文件的位置更新为

/usr/bin/pylint3

它奏效了。

当你安装模块时,你需要定位你特定的 python 主版本号。

我必须对 numpy 和 scipy 等做同样的事情。

关于python - Eclipse 中的 PyLint,步骤 linting python 运行时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27892607/

相关文章:

python - Centos 6 - sudo 在为 Python 3.4 安装 mysqlclient 时无法识别 pip3.4

java - 随机数无法解析为类型 - Java 本身的拼写错误

python - Pylint 找不到 SQLAlchemy 查询成员

java - 加载大表时的性能问题(SWT/JFace)

python - Type-ast(setup.py)的构建轮:状态为 'error'

python - 如何并行安装 python2 和 python3 的 pylint

python Pandas : filter out records with null or empty string for a given field

python - 如何在 python 3 中将字节文字列表转换为字符串文字?

python - 正则表达式子文本 block 在表达式的开头具有精确的字符串(python)

Bat 和 Eclipse 之间的 Java 文件同步