首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Sublime text 3.1.1中的Pylinter仍未使用Python2.7

Sublime text 3.1.1中的Pylinter仍未使用Python2.7
EN

Stack Overflow用户
提问于 2018-11-21 23:26:32
回答 1查看 288关注 0票数 18

以下是我的pylinter设置:

代码语言:javascript
运行
复制
    {
        // 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错误?

EN

回答 1

Stack Overflow用户

发布于 2019-01-30 04:43:04

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

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

代码语言:javascript
运行
复制
"executable": "C:\\Python27\\Scripts\\pylint.exe"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53415317

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档