question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode doesn't find linters installed using a different python

See original GitHub issue

Environment data

VS Code version: 1.18.1 Python Extension version: 0.8.0 OS and version: OS X Sierra

I have three primary python installations:

  1. /usr/bin/python - this is the system python, and I don’t use it, but haven’t overwritten the symlink so that I don’t break any MacOS functionality.
  2. /usr/local/bin/python2 - installed via homebrew, used when I need to run python2 or create python2 venv’s
  3. /usr/local/bin/python3 - installed via homebrew, used when I need to run python3 or create python3 venv’s

I normally run flake8, pylint, and pycodestyle as linters, and I typically install them into the primary python that I’m using, which is python2 (work) or python3 (personal).

After installation, I can verify that they are available on the command line:

~ ❯❯❯ which flake8
/usr/local/bin/flake8
~ ❯❯❯ which pydocstyle
/usr/local/bin/pydocstyle
~ ❯❯❯ which pylint
/usr/local/bin/pylint

So I would expect that as soon as I enable these linters in my settings.json, that VSCode python extension could find them, as the default command to trigger them is simply "flake8", "pylint", and "pydocstyle".

However, for some reason this extension isn’t picking them up… I keep getting the banner message saying these linters aren’t installed.

When I pin the location, then linting starts working fine:

"python.linting.flake8Path": "/usr/local/bin/flake8",
"python.linting.pydocstylePath": "/usr/local/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/bin/pylint"

I spent a while searching this issue tracker, but couldn’t find any previous reports of this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
brettcannoncommented, Dec 15, 2017

I will re-open this as a feature enhancement request.

2reactions
jeffwidmancommented, Dec 14, 2017

Hmm… so I saw 0.9.0 was out and I tried this.

The behavior did not change. VSCode still could not find the linters, despite them being easily found with which pylint|flake8|pydocstyle.

It’s not like I have a super custom path either, they are sitting in /usr/local/bin/ which is the default path for anyone using Homebrew. The only thing I haven’t done is overridden the macOS default python with Homebrew’s python2 because shadowing the system python is risky.

Are you sure you don’t want to have VSCode have a fallback of checking the system path for the existence of pylint, flake8, pydocstyle etc?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linting Python in Visual Studio Code
To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python.linting.<linter> ...
Read more >
Error message "Linter pylint is not installed" - Stack Overflow
Check the path Pylint has been installed to, by typing which pylint on your terminal. You will get something like: /usr/local/bin/pylint.
Read more >
Linting | Python in Visual Studio Code
Linting within the extension is supported on the following: Pylint (this is the default linter used); Pep8; Flake8; mypy; pylama; pydocstyle; prospector ...
Read more >
“linter pylint is not installed” in VSCode - LinuxPip
1 Pylint is actually not installed · 2 Explicitly specify Python binary path · 3 Pylint vs Pylint3 (Linux specific) · 4 Check...
Read more >
Unable to Install Pylint - Python - Code with Mosh Forum
Try to reinstall python, and then run python in vs code. I think then you may get a pop up for installing pylint....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found