2

I ran pip install --user pylint without getting any error, but I get pylint: command not found when I try pylint foo.py although there is a directory /Users/erc/Library/Python/2.7/lib/python/site-packages/pylint containing what I would guess are all the necessary files (although no pylint.py but maybe the __main__.py or __ini__.py are there for that). Also, I get nothing withwhich pylint.

What can I try?

Antoine
  • 600
  • 7
  • 19
  • What is the output of running `which pylint` in your shell? – Erty Seidohl Jun 08 '18 at 17:27
  • @ErtySeidohl As I explain, the output is... nothing! I type `which pylint` press enter, and I get a new line with a new prompt. – Antoine Jun 10 '18 at 16:45
  • That means that `pylint` is not on your path. You'll need to add the containing folder to your path. https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix – Erty Seidohl Jun 10 '18 at 22:13
  • I tried adding the folder`/Users/erc/Library/Python/2.7/lib/python/site-packages/pylint` to my `PATH` variable, but again `which pylint` returns nothing. I notice that this is a *folder*, and that there is no executable. What exactly happens when I run `pylint foo.py`? – Antoine Jul 10 '18 at 22:22
  • 1
    So I can use `pylint` by running `python -m pylint foo.py` by following [this note for Windows users](https://docs.pylint.org/en/1.6.0/installation.html) (I am on a mac...) Also, up on that page there is the instruction to install from source distribution: `python setup.py install`, which I presume would create `pylint.py`? At any rate, I *don't* have `setup.py`, which probably should have been installed, but I didn't get any error message when running `pip install....` I am not sure what is going on. – Antoine Jul 13 '18 at 22:14
  • Possible duplicate of [which files get installed when \`pip\` installing \`pylint\`?](https://stackoverflow.com/questions/51358987/which-files-get-installed-when-pip-installing-pylint) – jdhao Nov 27 '19 at 06:59

1 Answers1

1

I had faced the same issue even though I had pylint as well as pip installed. The issue is because the path is not pointing to the place where these libraries are present. eg: my path - programs/python/python35/ and whereas my pip and pylint were installed in programs/python/python35/Scripts. So when I added the path to environment variable it worked.

rossi
  • 21
  • 3