pallets/markupsafe

Unable to import 'soft_unicode' from 'MarkUpSafe'

varun379 opened this issue · 3 comments

I am trying to run an airflow pipeline in Docker and receive the following error:

Traceback (most recent call last):
File "/usr/local/bin/airflow", line 25, in
from airflow.configuration import conf
File "/usr/local/lib/python3.7/site-packages/airflow/init.py", line 42, in
from airflow.models import DAG
File "/usr/local/lib/python3.7/site-packages/airflow/models/init.py", line 21, in
from airflow.models.baseoperator import BaseOperator, BaseOperatorLink # noqa: F401
File "/usr/local/lib/python3.7/site-packages/airflow/models/baseoperator.py", line 36, in
import jinja2
File "/usr/local/lib/python3.7/site-packages/jinja2/init.py", line 33, in
from jinja2.environment import Environment, Template
File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 15, in
from jinja2 import nodes
File "/usr/local/lib/python3.7/site-packages/jinja2/nodes.py", line 19, in
from jinja2.utils import Markup
File "/usr/local/lib/python3.7/site-packages/jinja2/utils.py", line 642, in
from markupsafe import Markup, escape, soft_unicode

I have MarkUpSafe==2.0.1 installed.

Appreciate any help!
Thanks

Duplicate of #282

You are using an unsupported version of Jinja, please update to the latest version if possible. Additionally, please read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early.

I am using the most recent version of jinja2. version 3.0.3 and still getting the same error.

Try installing that version in a new virtulenv, you'll notice that you can import jinja2 without error. You'll need to talk to Airflow about that, my understanding is that they currently pin Jinja<3 in their current release.