SublimeLinter-flake8: Recent update breaks the plugin
The latest update breaks sublimelinter-flake8. To confirm the update is the problem I reverted back to the v2.1.0 where everything works fine.
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/bin/flake8
SublimeLinter: find_python: <= ('/usr/bin/python', '/usr/bin/flake8', 2, 7)
SublimeLinter: flake8 version query: /usr/bin/python /usr/bin/flake8 --version
SublimeLinter: WARNING: no flake8 version could be extracted from:
Traceback (most recent call last):
File "/usr/bin/flake8", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3019, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3003, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 655, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 963, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'flake8==3.2.1' distribution was not found and is required by the application
Here’s is the output from flake8
mandeep@debian:~$ which flake8
/usr/bin/flake8
mandeep@debian:~$ /usr/bin/flake8 --version
3.2.1 (mccabe: 0.5.3, pycodestyle: 2.2.0, pyflakes: 1.3.0) CPython 3.5.3 on Linux
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 22 (3 by maintainers)
Commits related to this issue
- Feature: add verbose log in debug for script version match fail I believe this would have helped many users to determine why certain linters fail to get an executable's version. It certainly helped ... — committed to asfaltboy/SublimeLinter3 by asfaltboy 7 years ago
- Feature: add verbose log in debug for script version match fail (#646) I believe this would have helped many users to determine why certain linters fail to get an executable's version. It certain... — committed to SublimeLinter/SublimeLinter by asfaltboy 7 years ago
@eblot For a quick and dirty fix, see my answer above.
First open
linter.py:Next, replace,
with,
and that should do it.
I’m also seeing this behaviour. In my case I get,
My crude workaround is to replace,
with,
in
linter.py. Then SublimeLinter-flake8 uses the correct version of Python (python3in my case, since I installedflake8withpip3).This issue affects me also.
I decided to use the git clone technique to install the old version.
Packages/:git clone https://github.com/SublimeLinter/SublimeLinter-flake8 -b 2.1.0.@asfaltboy you are correct, the default Python in
/usr/bin/pythonis indeed 2.7, and is the macOS provided Python, which I do not use at all (per se).And there is nothing in
/usr/local/bin/python. Only python3 exists. You may have pointed me to right direction, I will try to symlink a bit later.And last, but not least, thank you very much for your support!
EDIT: I made a symlink as follows:
ln -s /usr/local/bin/python3 /usr/local/bin/pythonand hey presto, linter is back alive! Just trying to test, did something else break 😉