To use linting for Python, I configured VS Code
like this:
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pep8Enabled": true,
"python.linting.lintOnTextChange": true,
"python.linting.lintOnSave": true
Then I opened a *.py
file and added an unnecessary space and saved, then I got an error: Linter pep8 is not installed
.
But I already installed pep8
. And by using VS Code console I can find the pep8
.
/usr/bin/python -m pip install pep8
loading ~/.zshrc_osx
ironsand@macbook ~ % /usr/bin/python -m pip install pep8
/usr/bin/python: No module named pip
ironsand@macbook ~ % which python
/usr/bin/python
ironsand@macbook ~ % which pep8
/usr/local/bin/pep8
ironsand@macbook ~ % pep8 --version
1.7.0
ironsand@macbook ~ % which python
/usr/bin/python
ironsand@macbook ~ %
Maybe I installed pep8
by using pip2
that is installed brew
.
python --version
Python 2.7.10
ironsand@macbook ~ % /usr/local/bin/pip2 install pep8
Collecting pep8
Using cached pep8-1.7.0-py2.py3-none-any.whl
Installing collected packages: pep8
Successfully installed pep8-1.7.0
What am I doing wrong?
MagicPython 1.0.12
Python 0.7.0
Python for VSCode 0.2.3
Deprecated use of [pep8] section name in favor of [pycodestyle] ; #591.
By default, Pylint will enforce PEP8-suggested names.
The problem with pep8 is because vscode now is using flake8, is basically the same, pep8 was renamed to pycodestyle, flake8 use pycodestyle, this is the old config:
"python.linting.pep8Enabled": true, // Don't use it
But now you can't find that config in vscode, the new config line now is:
"python.linting.flake8Enabled": true, // This is the new config for pep8
If the second option didn't work, you can try this:
"python.linting.pycodestyleEnabled": true // You need: pip install pycodestyle
I hope this answer is helpful for you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With