Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

python 3.x - Getting errors after installing uinstalling flake8 plugins. Errors thrown when doing --help or --version

I was playing around with different flake8 plugins today and after uninstalling one of them and installing a new one, flake8 --version no longer works for me.

the flake8 packages I had at the time were

(python3) $ flake8 --version 3.8.4 (flake8-bugbear: 20.11.1, mccabe: 0.6.1, naming: 0.11.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.8.2 on Darwin

after which I had ran

  • pip uninstalled flake8-bugbear
  • pip install flake8-docstrings
  • pip uninstall flake8-docstrings
  • pip install flake8-comprehensions

It now breaks with this error on flake8 --version

(python3) $ flake8 --version
Traceback (most recent call last):
  File "/Users/dtan/code/python3/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/main/application.py", line 363, in run
    self._run(argv)
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/main/application.py", line 350, in _run
    self.initialize(argv)
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/main/application.py", line 332, in initialize
    self.parse_configuration_and_cli(
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/main/application.py", line 182, in parse_configuration_and_cli
    self.options, self.args = aggregator.aggregate_options(
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/options/aggregator.py", line 45, in aggregate_options
    parsed_config = config_parser.parse()
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/options/config.py", line 312, in parse
    return self.merge_user_and_local_config()
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/options/config.py", line 277, in merge_user_and_local_config
    config = self.parse_local_config()
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/options/config.py", line 240, in parse_local_config
    return self._parse_config(config)
  File "/Users/dtan/code/python3/lib/python3.8/site-packages/flake8/options/config.py", line 217, in _parse_config
    value = method(self.program_name, option_name)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/configparser.py", line 828, in getboolean
    return self._get_conv(section, option, self._convert_to_boolean,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/configparser.py", line 808, in _get_conv
    return self._get(section, conv, option, raw=raw, vars=vars,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/configparser.py", line 803, in _get
    return conv(self.get(section, option, **kwargs))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/configparser.py", line 1163, in _convert_to_boolean
    raise ValueError('Not a boolean: %s' % value)
ValueError: Not a boolean: true # Print the source code generating the error/warning in question

I've already tried uninstalling & reinstalling flake8 with no luck. I assume that something is broken on the documentation stuff since doing flake8 --help will also throw this error


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It seems one of the plugins had added a config parser and changed one of the configuration files. When uninstalled the parser was removed but it left the changes in config file(s).

You need to run through all flake8 config files and remove config sections for uninstalled plugins.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...