【发布时间】:2017-09-02 07:12:44
【问题描述】:
为了对 Python 使用 linting,我像这样配置了 VS Code:
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pep8Enabled": true,
"python.linting.lintOnTextChange": true,
"python.linting.lintOnSave": true
然后我打开一个*.py文件并添加了一个不必要的空间并保存,然后我得到一个错误:Linter pep8 is not installed。
但我已经安装了pep8。通过使用 VS Code 控制台,我可以找到 pep8。
使用 VS Code 控制台
/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 ~ %
也许我是通过使用 pip2 安装的 pep8 安装的 brew。
使用操作系统控制台(iTerm2)
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
我做错了什么?
插件
MagicPython 1.0.12
Python 0.7.0
Python for VSCode 0.2.3
【问题讨论】:
-
尝试为 VSCode 安装 Python 并 pip install
flake8。 -
我已经安装了
Python for VSCode。我安装了flake8,但我得到了同样的错误。我会在我的问题中添加插件信息。