bw2 / ConfigArgParse

A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.
MIT License
728 stars 121 forks source link

no attribute 'ConfigParser' #197

Closed sdarwin closed 3 years ago

sdarwin commented 4 years ago

The README has this example:

# in your configargparse setup
import configargparse
import yaml

parser = configargparse.ConfigParser(
    config_file_parser_class=configargparse.ConfigparserConfigFileParser
)
parser.add_argument('--system1_settings', type=yaml.safe_load)

args = parser.parse_args() # now args.system1 is a valid python dict

If I run that (with python 3.6 on Ubuntu 18.04) an error appears:

# python3 test.py 
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    parser = configargparse.ConfigParser(
AttributeError: module 'configargparse' has no attribute 'ConfigParser'