SublimeText在virtualenv中使用pyflakes整理Python3

时间:2018-07-30 00:55:24

标签: python sublimetext3 virtualenv sublimelinter pyflakes

当我在Sublime中打开Python文件并删除诸如def myFunction():末尾的简单内容时,我希望短绒棉布在檐槽中添加一个红色圆圈。但是我什么都没看到。

我注意到Sublime窗口底部显示“ pyflakes(erred)”。


安装依赖项

# Sublime v 3.1.1
# Sublime package install SublimeLinter
# Sublime package install SublimeLinter-pyflakes

pip3 install pyflakes
which pyflakes
# /Users/macbook/Desktop/my_virtual_env/bin/pyflakes

试图告诉我的孩子在“ MyProj.sublime-project” 设置中使用的路径

{
    "folders":[
        {
            "path": "."
        }
    ],
    "SublimeLinter.linters.pyflakes.python": "/Users/macbook/Desktop/my_virtual_env/bin/python3"
}

更新:在加载views.py

时升华控制台输出
SublimeLinter: #10 linter.py:907: 'pyflakes' is linting 'views.py'
SublimeLinter: #10 python_linter.py:42: pyflakes: wanted python is 'None'
SublimeLinter: #10 python_linter.py:93: pyflakes: trying to use globally installed pyflakes
SublimeLinter: #10 python_linter.py:101: WARNING: cannot locate 'pyflakes'. Fill in the 'python' or 'executable' setting.

1 个答案:

答案 0 :(得分:0)

这些设置位于键settings下。例如

{
    "folders": [
        {
            "path": "."
        },
    ],

    "settings": {
        "SublimeLinter.linters.pyflakes.python": "..."
    }
}