AttributeError: module 'jinja2.ext' has no attribute 'with_'

Viewed 2382

I tried to install eli5 Python package via the below command in my google colab file.

!pip install eli5

And I'm getting this error when running the above command.

AttributeError: module 'jinja2.ext' has no attribute 'with_'

I tried to update jinja2 via the below commands, but it didn't resolve the issue.

!pip install --upgrade aiohttp_jinja2

!pip install --upgrade jinja2>=3.0

How to fix this issue?

1 Answers

This problem is caused by incorrect versioning of the jinja2 package inside the eli5 itself. There are some PRs that address this issue.

So you can:

  • wait for those PRs to be released in the new eli5 version

or

  • quickfix it by installing jinja2 of version 3.0.0 - 3.0.2

!pip install --upgrade jinja2>=3.0 didn't work because, I suppose, pip installed version greater than 3.0.2

Related