简体   繁体   中英

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:

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. Should I specify somewhere a path to modules?

The plugin name is 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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