2

I have an app named "diary" in my Django project:

school_diary/
    diary/
        <standart files inside app>
        views.py
        forms.py

Inside my views.py I make this import:

from . import forms

PyLint marks it as error. Here's what I have inside my settings.json:

{
    ...,
    "python.linting.enabled": true,
    "on.linting.pylintEnabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.maxNumberOfProblems": 200,
    "python.linting.pylintPath": "/home/alantheknight/Python/Environments/secenv/bin/pylint",
    "python.pythonPath": "/home/alantheknight/Python/Environments/secenv/bin/python3.7",
    ...

Also, I read about generating .pylintrc, so I ran this command:

$ pylint --generate-rcfile > ~/.pylintrc

Where have I made a mistake?

  • Oh, also I've included `"python.linting.pylint.pylintArgs": ["--load-plugins", "pylint-django"]` into my VSCode settings. – AlanTheKnight May 29 '20 at 11:05

1 Answers1

0

This is a common error that most people come across. You have not installed pylint in the same environment that contains your python packages. The environment selected in VS Code is displayed at the bottom left on the status bar of VS Code.

Take a look at stackoverflow/pylint-unable-to-import-error-how-to-set-pythonpath. and also pythonVSCodeDocs/docs/troubleshooting_linting