gpt4 book ai didi

python - 运行 flake8 给出 - AttributeError : 'OptionManager' object has no attribute 'config_options'

转载 作者:行者123 更新时间:2023-11-28 16:59:31 25 4
gpt4 key购买 nike

我使用以下命令安装了 flake8

pip3 install flake8

从终端执行 flake8 会出现以下错误。

Traceback (most recent call last):
File "/home/bilesh/.local/bin/flake8", line 11, in <module>
sys.exit(main())
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/main/cli.py", line 18, in main
app.run(argv)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/main/application.py", line 394, in run
self._run(argv)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/main/application.py", line 381, in _run
self.initialize(argv)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/main/application.py", line 365, in initialize
self.register_plugin_options()
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/main/application.py", line 206, in register_plugin_options
self.check_plugins.register_options(self.option_manager)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/plugins/manager.py", line 496, in register_options
list(self.manager.map(register_and_enable))
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/plugins/manager.py", line 302, in map
yield func(self.plugins[name], *args, **kwargs)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/plugins/manager.py", line 492, in register_and_enable
call_register_options(plugin)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/plugins/manager.py", line 404, in generated_function
return method(optmanager, *args, **kwargs)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/plugins/manager.py", line 221, in register_options
add_options(optmanager)
File "/home/bilesh/.local/lib/python3.6/site-packages/flake8/_pyflakes.py", line 79, in add_options
parser.config_options.extend(['builtins', 'doctests',
AttributeError: 'OptionManager' object has no attribute 'config_options'

从 2016 年开始发现以下错误,但似乎已修复。

https://github.com/PyCQA/flake8-import-order/issues/79

不确定我在这里做错了什么。任何帮助将不胜感激。

$ pip3 freeze | grep flake8
flake8==3.7.7
flake8-docstrings==1.3.0
flake8-polyfill==1.0.2

最佳答案

因此,根据 phd 发表的评论在这个问题上,我做了以下事情。

  1. 卸载flake8:pip3卸载flake8
  2. 清理目录:sudo rm -R/path/to/directory/flake8
  3. 重新安装 flake8:pip3 install flake8

它成功了:)

关于python - 运行 flake8 给出 - AttributeError : 'OptionManager' object has no attribute 'config_options' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55427406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com