https://prefect.io logo
d

David Yang

02/18/2022, 4:27 PM
Anyone got this error today? Traceback (most recent call last): File "/usr/local/bin/dbt", line 5, in <module> from dbt.main import main File "/usr/local/lib/python3.9/site-packages/dbt/main.py", line 11, in <module> import dbt.version File "/usr/local/lib/python3.9/site-packages/dbt/version.py", line 11, in <module> import dbt.semver File "/usr/local/lib/python3.9/site-packages/dbt/semver.py", line 8, in <module> import dbt.utils File "/usr/local/lib/python3.9/site-packages/dbt/utils.py", line 9, in <module> import jinja2 File "/usr/local/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in <module> from .environment import Environment File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 25, in <module> from .defaults import BLOCK_END_STRING File "/usr/local/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in <module> from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 File "/usr/local/lib/python3.9/site-packages/jinja2/filters.py", line 13, in <module> from markupsafe import soft_unicode ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/site-packages/markupsafe/__init__.py) It seems that we have to downgrade markupsafe: Downgrading markupsafe to 2.0.1 fixes the issue on my side.
pip install markupsafe==2.0.1
k

Kevin Kho

02/18/2022, 4:28 PM
Haven’t seen it..looks like a dbt dependency version conflict right?
d

David Yang

02/18/2022, 4:29 PM
Yes. It just happened today.
k

Kevin Kho

02/18/2022, 4:30 PM
Gotcha that might be word reporting on their discourse if you feel like it
I suspect more people will run into it
d

David Yang

02/18/2022, 4:30 PM
yeah... seems it's dbt problem. not prefrect
m

Matthias

02/18/2022, 4:33 PM
Strange, in the current version of dbt the markupsafe package is pinned to the one you downgraded to: https://github.com/dbt-labs/dbt-core/blob/main/core/setup.py#L55
d

David Yang

02/18/2022, 6:19 PM
upgrading dbt to 1.0.2 could solve the issue... I'll let your guys know if it works.
m

Matthias

02/18/2022, 6:31 PM
Which version did you use before?
d

David Yang

02/18/2022, 6:32 PM
1.0.1
m

Matthias

02/18/2022, 6:50 PM
I see, in that version there is no explicit version of markupsafe specified. This is a dependency of Jina2, but set very broadly e.g
>0.23
so that’s why you explicitly had to downgrade it. Am alternative fix is to pin the version in the requirements of your application and use dbt 1.0.1.
Still think it is worth mentioning on their discourse/slack channel though… seems the release of the latest markupsafe is only 16hrs old so that’s why it was never a problem before…
💯 1
d

David Yang

02/18/2022, 8:19 PM
After I upgrade dbt to 1.0.2, the error is gone. Upgrading dbt or downgrading markupsafe with dbt version earlier than 1.0.2 works.
m

Matthias

02/18/2022, 8:26 PM
Indeed, in version 1.0.2, the markupsafe version is pinned to 2.0.1!
3 Views