Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when importing eli5 0.11.0 #417

Open
dvorst opened this issue May 1, 2022 · 0 comments
Open

AttributeError when importing eli5 0.11.0 #417

dvorst opened this issue May 1, 2022 · 0 comments

Comments

@dvorst
Copy link

dvorst commented May 1, 2022

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.

  • the error occurs with versions: 3.1.2, 3.1.1, 3.1.0.
  • the error does not occur with version 3.0.3

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

  • ModuleNotFoundError: No module named 'sklearn.metrics.scorer'
  • ModuleNotFoundError: No module named 'sklearn.feature_selection.base'
@dvorst dvorst changed the title AttributeError when importing eli5 0.11.0 AttributeError when importing eli5 0.11.0 with jinja2 > 3.0.3 - possible solution is provided May 1, 2022
@dvorst dvorst changed the title AttributeError when importing eli5 0.11.0 with jinja2 > 3.0.3 - possible solution is provided AttributeError when importing eli5 0.11.0 May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant