3

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?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Sanushi Salgado
  • 1,195
  • 1
  • 11
  • 18

2 Answers2

3

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

0

I encounter the same problem, I debugged the issue with Pycharm. I search for the tag jinja2.ext and found one package using this. To resolve that issue, I updated the package to the latest version.

In my case, I updated the package Flask-DebugToolbar 0.11.0 to 0.13.1. It resolves my issue.