1

I was installing a pylint version for Django and the tutorial states:

Ensure pylint-django is installed and on your path and then execute:

pylint --load-plugins pylint_django [..other options..]

I initially installed pylint using $pip install pylint. But when I execute $pylint --load-plugins pylint_django it throws up an error saing that 'pylint' is not recognized as an internal or external command, operable program or batch file.

Why is this happening?

2
  • are you familiar with the $PATH variable in your shell? Commented Dec 18, 2019 at 4:03
  • @aws_apprentice No. And bdw, im using cmder on Windows. Commented Dec 18, 2019 at 4:05

1 Answer 1

3

There are two questions here. One is what is PATH and why is it needed, the other is why is pylint not working and although related they have different answers. I will explain both.

First you have to understand the concept of PATH. Whenever you type a command(let's say you typed command) in cmd in Windows or in a terminal in MacOS or Linux OS, what you are really saying is execute a program with the name command.

Now the OS cannot possibly look at all the secondary storage devices to find a program with the same name. That would take a long time and there might be multiple programs with the same name. So, it has a list of directories where it looks for that program. This list of directories are known as the PATH.

If you are executing the command pylint then you are telling Windows to run a program of the name pylint that exists in one of the directories in the PATH. Windows tries to do that but can't find anything that exists with that name in its list of PATH directories. So, it gives you that error. You can see your windows PATH like explained here.

All python modules are added in the same directory that should exist in the PATH already. So the reason pylint command is not working is probably something else.

The other problem is why pylint is not working. I think the reason for that is you should execute

pip install pylint-django

and not

pip install pylint

Sign up to request clarification or add additional context in comments.

2 Comments

Great answer! How can i ensure that pylint-django is installed? Where do I have to look?
To see where python modules are installed and which are installed, check stackoverflow.com/q/2927993/4249232 . Also, if I helped you and answered your question, please upvote and/or select my answer as the best answer :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.