Sublime Forum

Problem using `flake8` for linting on Sublime Text 3

#1

I’ve been unsuccessfully trying to use the SublimeLinter-flake8 on my Xubuntu 16.04 LTS laptop. I have Python 3.7.7 installed through the Anaconda distribution, as well as the flake8 package. I’m also using the Anaconda IDE plugin for Sublime Text 3, with Anaconda’s linting turned off.

But I keep getting the same error message whenever I type some Python code in:

SublimeLinter: #1 flake8 <untitled 25> ERROR:
=============================================

Traceback (most recent call last):
  File "/home/srdjan/anaconda3/bin/flake8", line 11, in <module>
    load_entry_point('flake8==3.7.7', 'console_scripts', 'flake8')()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/flake8/main/cli.py", line 2, in <module>
    from typing import List, Optional
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1347, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1003, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry

I’ve been unsuccessfully trying to use the SublimeLinter-flake8 on my Xubuntu laptop. I have Python 3.7.7 installed through the Anaconda distribution, as well as the flake8 package. I’m also using the Anaconda IDE plugin for Sublime Text 3, with Anaconda’s linting turned off.

But I keep getting the same error message whenever I type some Python code in:

SublimeLinter: #1 flake8 <untitled 25> ERROR:
=============================================

Traceback (most recent call last):
  File "/home/srdjan/anaconda3/bin/flake8", line 11, in <module>
    load_entry_point('flake8==3.7.7', 'console_scripts', 'flake8')()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/flake8/main/cli.py", line 2, in <module>
    from typing import List, Optional
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1347, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1003, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry

Strangely enough, I was having somewhat similar problems when I was using SublimeLinter-pycodestyle and SublimeLinter-pyflakes , where pyflakes would keep throwing these weird error messages. I was never able to get it to work.

Should I perhaps uninstall pycodestyle and pyflakes from my laptop, now that I have flake8 and its accompanying SublimeLinter-flake8 plugin?

0 Likes