平时用的 sublime + sublimelinter + sublimelinter-pyflakes 来进行代码的格式检测 但是突然发现 python 的新语法 f"hello {name}" 会被检查出 syntax error 打开调试界面看了一下发现了这么一段
SublimeLinter: find_python(version=None, script='flake8', module=None)
SublimeLinter: find_python: default python = /usr/bin/python
SublimeLinter: find_python: available version = {'minor': 7, 'major': 2}
SublimeLinter: find_python: 'flake8' path = /usr/local/bin/flake8
SublimeLinter: find_python: <= ('/usr/bin/python', '/usr/local/bin/flake8', 2, 7)
SublimeLinter: flake8 version query: /usr/bin/python /usr/local/bin/flake8 --version
虽然上面这个是 flake8 但请大家不要介意 这个 find_python default python = /usr/bin/python 让我很不解
因为我在 sublimelinter 的配置文件里面都已经设置了 @python3: "3.6"
具体内容如下
SublimeLinter: find_posix_python: python3 => /usr/local/python3.6/bin/python3
SublimeLinter: find_python: system python = /usr/local/python3.6/bin/python3
SublimeLinter: find_python: available version = {'minor': 6, 'major': 3}
SublimeLinter: find_python: <= ('/usr/local/python3.6/bin/python3', None, 3, 6)
SublimeLinter: sys.path for /usr/local/python3.6/bin/python3:
/usr/local/python3.6/lib/python36.zip
/usr/local/python3.6/lib/python3.6
/usr/local/python3.6/lib/python3.6/lib-dynload
/usr/local/python3.6/lib/python3.6/site-packages
SublimeLinter: pyflakes imported <module 'pyflakes.api' from '/usr/local/python3.6/lib/python3.6/site-packages/pyflakes/api.py'>
SublimeLinter: pep8 imported <module 'pep8' from '/usr/local/python3.6/lib/python3.6/site-packages/pep8.py'>
SublimeLinter: pyflakes version: 1.6.0
SublimeLinter: pyflakes: (>= 0.7.3) satisfied by 1.6.0
SublimeLinter: pyflakes activated: <builtin>
SublimeLinter: pep8 version: 1.7.0
SublimeLinter: pep8: (>= 1.4.6) satisfied by 1.7.0
SublimeLinter: pep8 activated: <builtin>
SublimeLinter: mypy version query: /usr/local/python3.6/bin/mypy --version
SublimeLinter: mypy version: 0.540
SublimeLinter: mypy: (>= 0.520) satisfied by 0.540
SublimeLinter: mypy activated: /usr/local/python3.6/bin/mypy (disabled in settings)
SublimeLinter: find_python(version=None, script='flake8', module=None)
SublimeLinter: find_python: default python = /usr/bin/python
SublimeLinter: find_python: available version = {'minor': 7, 'major': 2}
SublimeLinter: find_python: 'flake8' path = /usr/local/bin/flake8
SublimeLinter: find_python: <= ('/usr/bin/python', '/usr/local/bin/flake8', 2, 7)
SublimeLinter: flake8 version query: /usr/bin/python /usr/local/bin/flake8 --version
SublimeLinter: WARNING: no flake8 version could be extracted from:
Traceback (most recent call last):
File "/usr/local/bin/flake8", line 7, in <module>
from flake8.main.cli import main
ImportError: No module named flake8.main.cli
希望对这个有研究的 V 友能帮忙看一下 感激不尽
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.