简体   繁体   English

Pylint 加载插件在 VS Code 中失败

[英]Pylint load-plugins fails in VS Code

Here is my config:这是我的配置:

"python.linting.pylintArgs": [
    "--load-plugins", 
    "pylint-quotes"
  ],

I installed pylint-quotes with pip and pip3 but I still get an error:我使用 pip 和 pip3 安装了 pylint-quotes,但仍然出现错误:

Traceback (most recent call last):
File "/usr/local/bin/pylint", line 11, in <module>
    sys.exit(run_pylint())
  File "/usr/local/lib/python2.7/site-packages/pylint/__init__.py", line 16, in run_pylint
    Run(sys.argv[1:])
  File "/usr/local/lib/python2.7/site-packages/pylint/lint.py", line 1274, in __init__
    linter.load_plugin_modules(self._plugins)
  File "/usr/local/lib/python2.7/site-packages/pylint/lint.py", line 500, in load_plugin_modules
    module = modutils.load_module_from_name(modname)
  File "/usr/local/lib/python2.7/site-packages/astroid/modutils.py", line 190, in load_module_from_name
    return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
  File "/usr/local/lib/python2.7/site-packages/astroid/modutils.py", line 232, in load_module_from_modpath
    mp_file, mp_filename, mp_desc = imp.find_module(part, path)
ImportError: No module named pylint-quotes

I'm using mac.我正在使用 mac。 Should I specify somewhere a path to modules?我应该在某处指定模块的路径吗?

The plugin name is pylint_quotes .插件名称是pylint_quotes

"python.linting.pylintArgs": [
"--load-plugins", 
"pylint_quotes"
],

This should work.这应该有效。

Are you sure that you have the same python at both places?你确定你在两个地方都有相同的蟒蛇吗? It might be the case that you are installing with different python (pip) and using another in VS.可能是您使用不同的 python (pip) 安装并在 VS 中使用另一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM