TeamHG-Memex / eli5

A library for debugging/inspecting machine learning classifiers and explaining their predictions
http://eli5.readthedocs.io
MIT License
2.74k stars 332 forks source link

AttributeError when importing eli5 0.11.0 #417

Open dvorst opened 2 years ago

dvorst commented 2 years ago

When importing eli5, I receive the error shown below. I have version 0.11.0 installed and use Python 3.10

Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\resume keywords\main.py", line 2, in <module>
    import eli5
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\eli5\__init__.py", line 6, in <module>
    from .formatters import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\eli5\formatters\__init__.py", line 9, in <module>
    from .html import format_as_html, format_html_styles
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\eli5\formatters\html.py", line 22, in <module>
    template_env = Environment(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 363, in __init__
    self.extensions = load_extensions(self, extensions)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 117, in load_extensions
    extension = t.cast(t.Type["Extension"], import_string(extension))
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\utils.py", line 149, in import_string
    return getattr(__import__(module, None, None, [obj]), obj)
AttributeError: module 'jinja2.ext' has no attribute 'with_'

EDIT: I have tried installing other versions of Jinja2.

EDIT2: When fixing this error, I encountered two others, both of these are due to using scikit-learn version 1.0.2