简体   繁体   English

Pylint:未安装 Linter pylint。 安装为扩展后 - VScode

[英]Pylint: Linter pylint is not installed. after installing as extension - VScode

I just installed python 3.8.3 and created a file.我刚刚安装了 python 3.8.3 并创建了一个文件。 a message shows up;出现一条消息;

Linter pylint is not installed.未安装 Linter pylint。 Source: Python (Extension)来源:Python(扩展)

I clicked the install button and I have this error message now...我单击了安装按钮,现在我收到此错误消息...

$ C:/Python38/python.exe c:\Users\JAEMIN\.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py pip install -U py 
lint --user

C:\Python38\python.exe: can't open file 'c:UsersJAEMIN.vscodeextensionsms-python.python-2020.6.90262pythonFilespyvsc-run-isolated.py': [Errno 
2] No such file or directory

I searched but nothing seems to work in my case.我进行了搜索,但在我的情况下似乎没有任何效果。

What is Linter pylint?什么是 Linter pylint? and do I need it?我需要吗?

thank you谢谢你

Let me directly pickup the documentation of pylint让我直接拿起pylint的文档

pylint皮林特

Pylint is a python linter which checks the source code and also acts as a bug and quality checker. Pylint 是一个 python linter,它检查源代码并充当错误和质量检查器。 It has more verification checks and options than just PEP8(Python style guide).它具有更多的验证检查和选项,而不仅仅是 PEP8(Python 样式指南)。

This is the most commonly used tool for linting in python.这是 python 中最常用的 linting 工具。

It includes the following features: Checking the length of each line Checking if variable names are well-formed according to the project's coding standard Checking if declared interfaces are truly implemented.它包括以下功能: 检查每行的长度 检查变量名称是否符合项目的编码标准 检查声明的接口是否真正实现。

Linter is an optional tool and it is used to check the source code for stylistic errors. Linter 是一个可选工具,用于检查源代码中的样式错误。

As the other answer described, pylint is code checking tool for stylistic errors.正如其他答案所述,pylint 是用于样式错误的代码检查工具。 If you want to get rid of the error message, I believe you just need to do pip install pylint .如果你想摆脱错误信息,我相信你只需要做pip install pylint

First, you should check whether the file 'c:\Users\JAEMIN.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py' exists.首先,您应该检查文件 'c:\Users\JAEMIN.vscode\extensions\ms-python.python-2020.6.90262\pythonFiles\pyvsc-run-isolated.py' 是否存在。 It's provided by the 'python' extension which you have installed.它由您安装的“python”扩展提供。 You can try to reinstall this extension.您可以尝试重新安装此扩展程序。 You'd better remove the 'ms-python.python-2020.6.90262' folder just in case, then install the 'python' extension again.您最好删除“ms-python.python-2020.6.90262”文件夹以防万一,然后再次安装“python”扩展。

Second, when you tried to install 'pylint' through command 'pip install pylint', you get the error: 'pip: command not found'.其次,当您尝试通过命令“pip install pylint”安装“pylint”时,会出现错误:“pip: command not found”。 It seems like you haven't created a virtual environment.好像您还没有创建虚拟环境。 If you created it, and you activate the environment(Ctrl+Shift+`), you can get pip work.如果您创建了它并激活了环境(Ctrl+Shift+`),您可以获得 pip 工作。 You can refer to this page for more information, and this is the recommended method.您可以参考页面了解更多信息,这是推荐的方法。 But you can still choose to use the default global python, but it seems like when you install the python3.8.3 you haven't chosen 'pip' on the first page.但是您仍然可以选择使用默认的全局 python,但是在安装 python3.8.3 时,您似乎没有在第一页选择“pip”。 So, the system can't find 'pip' command.因此,系统找不到“pip”命令。 A few months ago, I remembered although you install python, you still need to install pip manually.几个月前,我记得虽然您安装了 python,但您仍然需要手动安装 pip。 You can refer to this page to know how to install pip.您可以参考页面了解如何安装 pip。

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

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