简体   繁体   English

如何在 vscode 中手动为 Django 添加 pylint?

[英]How to add pylint for Django in vscode manually?

I have created a Django project in vscode.我在 vscode 中创建了一个 Django 项目。 Generally, vscode automatically prompts me to install pylint but this time it did not (or i missed it).通常,vscode 会自动提示我安装 pylint,但这次没有(或者我错过了)。 Even though everything is running smoothly, I am still shown import errors.即使一切运行顺利,我仍然会看到导入错误。 How do I manually install pytlint for this project?如何为此项目手动安装 pytlint?

Also,in vscode i never really create a 'workspace'.此外,在 vscode 中,我从未真正创建过“工作区”。 I just create and open folders and that works just fine.我只是创建并打开文件夹,效果很好。

ps.附言。 Im using pipenv.我正在使用 pipenv。 dont know how much necessary that info was.不知道该信息有多少必要。

Hi you must active your venv at the first then install pylint (pip install pylint)嗨,您必须首先激活您的 venv,然后安装 pylint(pip install pylint)

In vscode: ctrl + shift + P then type linter (choose "python:select linter") now you can choose your linter (pylint)在 vscode: ctrl + shift + P然后输入 linter (选择 "python:select linter") 现在你可以选择你的 linter (pylint)

I hope it helps you希望对你有帮助

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

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