VSCode doesn't find linters installed using a different python
See original GitHub issueEnvironment 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:
/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./usr/local/bin/python2
- installed via homebrew, used when I need to run python2 or create python2 venv’s/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:
- Created 6 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top GitHub Comments
I will re-open this as a feature enhancement request.
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 withwhich 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 defaultpython
with Homebrew’spython2
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?