Sublime文字3.1.1中的Pylinter仍然不使用Python2.7

时间:2018-11-21 15:26:32

标签: python sublimetext3 pylint

这是我的pylinter设置:

{
    // When versbose is 'true', various messages will be written to the console.
    // values: true or false
    "verbose": false,
    // The full path to the Python executable you want to
    // run Pylint with or simply use 'python'.
    "python_bin": "/usr/bin/python2.7",
    // The following paths will be added Pylint's Python path
    "python_path": [],
    // Optionally set the working directory
    "working_dir": null,
    // Full path to the lint.py module in the pylint package
    "pylint_path": null,
    // Optional full path to a Pylint configuration file
    "pylint_rc": null,
    // Set to true to automtically run Pylint on save
    "run_on_save": true,
    // Set to true to use graphical error icons
    "use_icons": false,
    "disable_outline": false,
    // Status messages stay as long as cursor is on an error line
    "message_stay": false,
    // Ignore Pylint error types. Possible values:
    // "R" : Refactor for a "good practice" metric violation
    // "C" : Convention for coding standard violation
    // "W" : Warning for stylistic problems, or minor programming issues
    // "E" : Error for important programming issues (i.e. most probably bug)
    // "F" : Fatal for errors which prevented further processing
    "ignore": [],
    // a list of strings of individual errors to disable, ex: ["C0301"]
    "disable": [],
    "plugins": []
}

我清楚地将python2.7可执行文件放在正确的位置(我认为)。这是which python2.7给我的道路。 然而,像print "test"这样的语句仍然返回E0001 Missing parentheses in call to print-一个经典的python3 vs 2错误。

如何获取它来检查python2.7错误?

1 个答案:

答案 0 :(得分:0)

您是否尝试过按照文档中的建议设置“可执行文件”? http://www.sublimelinter.com/en/stable/linter_settings.html#executable

我的配置中的代码段(Windows):

"executable": "C:\\Python27\\Scripts\\pylint.exe"