-
Notifications
You must be signed in to change notification settings - Fork 178
Dependency issue: "ImportError: cannot import name 'soft_unicode' from 'markupsafe'" #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, I’ve encountered this recently too. Are you installing Amaranth with pip or with poetry? |
@lethalbit hit this issue yesterday and it turned out to be caused by using an out of date Jinja2 - if you're using Jinja2 versions less than 3 then you'll hit this. |
The issue is that if you upgrade to Jinja2 3.1.0 or higher this will break Amaranth itself as the API changes made in that version rename features used in amaranth.build |
@modwizcode I installed via pip, and @dragonmux I got |
You want Jinja2 version 3.0.3 - this will work correctly and without error |
The correct fix is likely to fix the use of deprecated structures in Amaranth and upgrade the constraint on Jinja2 if possible. Otherwise Amaranth will have to fix a dependency on a specific version of markupsafe to avoid letting the constraint be filled with a newer incompatible version. You hit this issue immediately with poetry because (mostly a guess) it’s constraint solver seems to try to solve for latest versions and pip seems to go for the earliest allowed versions. |
I installed amaranth for the first time (version 0.3), and encountered this error:
I found the same error which says that it's due to a change in version 2.1.0 of markupsafe.
I fixed it locally by changing to an older version with
pip install markupsafe==2.0.1
.Stack trace:
The text was updated successfully, but these errors were encountered: