allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.74k stars 2.24k forks source link

`allennlp test-install` broken without `checklist` #5588

Closed h-vetinari closed 2 years ago

h-vetinari commented 2 years ago

This is a bit of fall-out from #5507; encountered in https://github.com/conda-forge/allennlp-feedstock/pull/35

+ allennlp test-install
[...]/lib/python3.9/site-packages/allennlp/confidence_checks/task_checklists/__init__.py:15: UserWarning: To use the checklist integration you should install ``allennlp`` with the "checklist" extra (e.g. ``pip install allennlp[checklist]``) or just install checklist after the fact.
  warnings.warn(
Traceback (most recent call last):
  File "[...]/bin/allennlp", line 11, in <module>
    sys.exit(run())
  File "[...]/lib/python3.9/site-packages/allennlp/__main__.py", line 39, in run
    main(prog="allennlp")
  File "[...]/lib/python3.9/site-packages/allennlp/commands/__init__.py", line 121, in main
    parser, args = parse_args(prog)
  File "[...]/lib/python3.9/site-packages/allennlp/commands/__init__.py", line 109, in parse_args
    import_plugins()
  File "[...]/lib/python3.9/site-packages/allennlp/common/plugins.py", line 79, in import_plugins
    import_module_and_submodules(
  File "[...]/lib/python3.9/site-packages/allennlp/common/util.py", line 362, in import_module_and_submodules
    import_module_and_submodules(subpackage, exclude=exclude)
  File "[...]/lib/python3.9/site-packages/allennlp/common/util.py", line 362, in import_module_and_submodules
    import_module_and_submodules(subpackage, exclude=exclude)
  File "[...]/lib/python3.9/site-packages/allennlp/common/util.py", line 351, in import_module_and_submodules
    module = importlib.import_module(package_name)
  File "[...]/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    from allennlp.confidence_checks.task_checklists.task_suite import TaskSuite
  File "[...]/lib/python3.9/site-packages/allennlp/confidence_checks/task_checklists/task_suite.py", line 6, in <module>
    from checklist.test_suite import TestSuite
ModuleNotFoundError: No module named 'checklist'
vikigenius commented 2 years ago

I don't this is specific to conda, I just encountered this error yesterday and I used pip to install allennlp. Using allennlp train command gives me the error.

h-vetinari commented 2 years ago

Yup, this is not conda-specific. The fix in #5589 should also not be conda-specific, I hope. 🙃

aphedges commented 2 years ago

I encountered this problem using a model from allennlp-models, and I can confirm that installing directly from the PR with pip fixes it.