takluyver / entrypoints

Discover and load entry points from installed packages
https://entrypoints.readthedocs.io/
MIT License
74 stars 29 forks source link

Getting a `configparser.DuplicateOptionError` when calling nbconvert #9

Closed ocefpaf closed 8 years ago

ocefpaf commented 8 years ago

I am seeing a similar problem as https://github.com/jupyter/nbconvert/issues/298 but I am using the latest entrypoints 0.2.2. One can reproduce the error below by installing jupyter and compliance-checker together and then issuing: entrypoints.get_single('nbconvert.exporters', 'python').load()

Traceback (most recent call last):
  File "/home/travis/miniconda/envs/IOOS/bin/jupyter-nbconvert", line 4, in <module>
    from nbconvert.nbconvertapp import main
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 99, in <module>
    class NbConvertApp(JupyterApp):
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 179, in NbConvertApp
    """.format(get_export_names()))
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/nbconvert/exporters/export.py", line 210, in get_export_names
    sorted(entrypoints.get_group_named('nbconvert.exporters'))
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/entrypoints.py", line 191, in get_group_named
    for ep in get_group_all(group, path=path):
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/entrypoints.py", line 202, in get_group_all
    for config, distro in iter_files_distros(path=path):
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/entrypoints.py", line 168, in iter_files_distros
    cp.read(path)
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/configparser.py", line 696, in read
    self._read(fp, filename)
  File "/home/travis/miniconda/envs/IOOS/lib/python3.5/configparser.py", line 1089, in _read
    fpname, lineno)
configparser.DuplicateOptionError: While reading from '/home/travis/miniconda/envs/IOOS/lib/python3.5/site-packages/compliance_checker-2.2.0-py3.5.egg-info/entry_points.txt' [line  3]: option 'acdd' in section 'compliance_checker.suites' already exists

Not sure how to fix that...

xref: https://github.com/ioos/compliance-checker/issues/300

takluyver commented 8 years ago

Looks like compliance_checker did something weird with entry points. Recent versions of pip refuse to install it. It was fixed in ioos/compliance-checker#279, but they haven't made a release yet.

ocefpaf commented 8 years ago

pip refusing that is the right way to go. Thanks for the fast response @takluyver!