尽管安装在虚拟环境中,Pylint无法正常工作

时间:2018-12-23 05:00:01

标签: django visual-studio-code virtualenv pylint

我是Django的新手,我一直试图在Vscode的虚拟环境中设置pylint。在安装过程中,我确保我处于虚拟环境中,并且已选择了虚拟环境python解释器。

用于安装的方法:

Collecting pylint
  Using cached https://files.pythonhosted.org/packages/a5/06/ecef826f319055e6b231716730d7f9047dd7524ffda224b521d989f085b6/pylint-2.2.2-py3-none-any.whl
Collecting astroid>=2.0.0 (from pylint)
  Using cached https://files.pythonhosted.org/packages/fc/53/8809bc008bad0300897281a7b320b286dc0e84e836396c0cff6279841e8a/astroid-2.1.0-py3-none-any.whl
Collecting isort>=4.2.5 (from pylint)
  Using cached https://files.pythonhosted.org/packages/1f/2c/22eee714d7199ae0464beda6ad5fedec8fee6a2f7ffd1e8f1840928fe318/isort-4.3.4-py3-none-any.whl
Collecting mccabe (from pylint)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting typed-ast; python_version < "3.7" and implementation_name == "cpython" (from astroid>=2.0.0->pylint)
  Using cached https://files.pythonhosted.org/packages/de/50/7571200eff27c5c30dafa595e355495e1de85aad5fa3fe4c206791d827ff/typed_ast-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting lazy-object-proxy (from astroid>=2.0.0->pylint)
  Using cached https://files.pythonhosted.org/packages/65/1f/2043ec33066e779905ed7e6580384425fdc7dc2ac64d6931060c75b0c5a3/lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting wrapt (from astroid>=2.0.0->pylint)
Collecting six (from astroid>=2.0.0->pylint)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: typed-ast, lazy-object-proxy, wrapt, six, astroid, isort, mccabe, pylint
Successfully installed astroid-2.1.0 isort-4.3.4 lazy-object-proxy-1.3.1 mccabe-0.6.1 pylint-2.2.2 six-1.12.0 typed-ast-1.1.1 wrapt-1.10.11

这很重要,这是日志:

{
"python.pythonPath": "venv/bin/python"
}
.vscode文件中的

settings.json包含以下代码:


    from celery.utils.log import get_task_logger
    from robobud.celery import app


    log = get_task_logger(__name__)

    @app.task
    def logging_task(name):
        log.info('hello %s', name)

尽管如此。短绒不起作用,也没有任何错误通知我。

1 个答案:

答案 0 :(得分:0)

我发现出了什么问题,不得不为Django安装pylint

pip install pylint-django