[英]Visual Studio Code Python extension: None of the default / built-in modules working (pylint, autopep8, etc)
It's my understanding that the Python extension's built-in features, eg, linting with pylint should work with the default user / global settings, and if an alternative linter is preferred, insertion of a full path to the executable is required.据我了解,Python 扩展的内置功能,例如,使用 pylint 进行 linting 应该与默认用户/全局设置一起使用,如果首选替代 linter,则需要插入可执行文件的完整路径。
In my case, none of the features are working, all emitting 'not installed' error messages, even after using the command palette and responding in the affirmative to the error dialog when asked '... install?'就我而言,所有功能都不起作用,即使在使用命令调色板并在询问“...安装?
Developer Tools > Console reveals: ~\AppData\Local\Programs\Python\Python38\python.exe -c "import pylint"... ... 'pylint' not installed.开发者工具 > 控制台显示:~\AppData\Local\Programs\Python\Python38\python.exe -c "import pylint"... ... 'pylint' 未安装。
at f.execModule (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:9:41305)在 f.execModule (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:9:41305)
at async d.run (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:1:210891)在异步 d.run (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:1:210891)
at async d.runLinter (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:75:1367669)]在异步 d.runLinter (c:\Users\Moron.vscode\extensions\ms-python.python-2019.10.44104\out\client\extension.js:75:1367669)]
and the same for autopep8, and down the line.和 autopep8 一样,下线。
Is it necessary to enter full paths to each of the default features' executables in the various settings (global, user, workspace) prior to using them?在使用它们之前,是否有必要在各种设置(全局、用户、工作区)中输入每个默认功能的可执行文件的完整路径? I've not seen any tutorials that mention this requirement.
我还没有看到任何提到这个要求的教程。
Globally installed tools are not used by default, but instead tools installed that can be executed using Python's -m
argument.默认情况下不使用全局安装的工具,而是安装可以使用 Python 的
-m
参数执行的工具。 If you would like to use globally-installed tools then you will need to specify them in your settings, eg "python.linting.pylintPath"
.如果您想使用全局安装的工具,则需要在设置中指定它们,例如
"python.linting.pylintPath"
。 But your best option is to create a virtual environment and install the tools there.但是您最好的选择是创建一个虚拟环境并在那里安装工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.