python - 在 Sublime Text 3 上使用 `flake8` 进行 linting 出现问题
问题描述
我一直没有成功尝试SublimeLinter-flake8
在我的 Xubuntu 笔记本电脑上使用它。我通过 Anaconda 发行版以及flake8
软件包安装了 Python 3.7.7。我还在为 Sublime Text 3 使用 Anaconda IDE 插件,并关闭了 Anaconda 的 linting。
但是每当我输入一些 Python 代码时,我都会收到相同的错误消息:
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
奇怪的是,我在使用SublimeLinter-pycodestyle
and时遇到了一些类似的问题SublimeLinter-pyflakes
,哪里pyflakes
会不断抛出这些奇怪的错误消息。我永远无法让它工作。
既然我已经拥有及其随附的插件pycodestyle
,我是否应该pyflakes
从我的笔记本电脑上卸载?flake8
SublimeLinter-flake8
解决方案
推荐阅读
- javascript - iOS 上的 Safari 在 javascript 执行期间抛出 SyntaxError,但在任何其他设备/浏览器上都没有
- ruby-on-rails - 如何用自定义方法补充 String 类?
- mysql - k8s 集群在并行运行 22 个气流工作 pod 时挂起
- python - AttributeError:模块“posts.views”没有属性“编辑”
- paypal-sandbox - 退款后订阅状态仍为“ACTIVE”
- highcharts - Highcharts 显示覆盖在系列窗格上的标题文本
- bash - 语句 f2=${f%????} 是什么意思?
- java - 单独端口上的弹簧启动资源
- react-native - 如何使用 react native mapbox 从集群中获取叶子?
- sql-server - T SQL 第二个字符串之后的任何内容