简体   繁体   English

Visual Studio Code Python 扩展:没有默认/内置模块工作(pylint、autopep8 等)

[英]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.

相关问题 带有 PyLint 和 autoPep8 的 Visual Studio 代码:如何避免 PyLint 抱怨我的行长? - Visual Studio code with PyLint and autoPep8: How can I avoid PyLint to complain about my line length? Visual Studio Code 和 Autopep8 格式化程序 - Visual Studio Code and Autopep8 Formatter 在使用 Visual Studio Code 和 autopep8 导入之前允许语句 - Allow statements before imports with Visual Studio Code and autopep8 emacs:python 为缩进设置制表符(pylint、autopep8、flycheck 等问题) - emacs: python set tabs for indentation (issue with pylint, autopep8, flycheck etc.) Python autopep8 和 VS Code 集成 - Python autopep8 and VS Code integration VS 代码,Python ext,autopep8 未格式化 - VS Code, Python ext, autopep8 not formatting vs-code MS Python扩展程序在Linux上找不到autopep8 - vs-code MS Python extension can't find autopep8 on Linux Windows 10 重新安装后 Autopep8 和其他模块不工作 - Autopep8 and other modules not working after Windows 10 reinstall 如果我已经安装了 python 扩展,如何将 VS Code 中的路径更改为扩展,以及 autopep8 的正确路径是什么? - How can I change the path in VS Code to the extension and what is the correct path to autopep8 if I already installed the python extension? Visual Studio Code安装python扩展pylint失败 - Visual Studio Code install python extension pylint failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM