Published on Friday, 6 May 2022
[SOLVED] Cannot import name 'environmentfilter' from 'jinja2'
I got this problem after installing Voilà from the Anaconda Terminal. Fixed by simply adjusting Jinja2 version using the pip command below.
While installing the voilà package in my Anaconda Terminal, these problems occurred:
- when starting Spyder from the Terminal, the IDE crashed and a jinja2-related error message popped up: cannot import name 'environmentfilter' from 'jinja2'
- at the same time, running a Jupyter Notebook gave me a very big 500 Internal Server Error as soon as I clicked on any .ipynb file
According to some users on the internet the jinja2 version could cause the problem (required to be <3.1, at that time) so I just checked with
conda list jinja2 which gave me a version ~2.11, which was fine.
So what was wrong? Well, it's not a mistery that using both pip and conda causes packages conflict problems, but luckily everything got solved by pip:
pip install "Jinja<3.1"
Hope this will be helpful to you too.