Skip to content
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

ImportError: cannot import name 'soft_unicode' from 'markupsafe' #1593

Closed
pllim opened this issue Feb 18, 2022 · 4 comments
Closed

ImportError: cannot import name 'soft_unicode' from 'markupsafe' #1593

pllim opened this issue Feb 18, 2022 · 4 comments

Comments

@pllim
Copy link

pllim commented Feb 18, 2022

2022-02-18T13:55:12.9961209Z           from jinja2 import Environment, FileSystemLoader
2022-02-18T13:55:12.9962165Z         File ".../python3.9/site-packages/jinja2/__init__.py", line 33, in <module>
2022-02-18T13:55:12.9962690Z           from jinja2.environment import Environment, Template
2022-02-18T13:55:13.0123423Z         File ".../python3.9/site-packages/jinja2/environment.py", line 15, in <module>
2022-02-18T13:55:13.0124029Z           from jinja2 import nodes
2022-02-18T13:55:13.0124565Z         File ".../python3.9/site-packages/jinja2/nodes.py", line 19, in <module>
2022-02-18T13:55:13.0124932Z           from jinja2.utils import Markup
2022-02-18T13:55:13.0125450Z         File ".../jinja2/utils.py", line 642, in <module>
2022-02-18T13:55:13.0125825Z           from markupsafe import Markup, escape, soft_unicode
2022-02-18T13:55:13.0126431Z       ImportError: cannot import name 'soft_unicode' from 'markupsafe' .../python3.9/site-packages/markupsafe/__init__.py)

From: https://github.com/astropy/astrowidgets/runs/5248500732?check_suite_focus=true

Might be caused by problem mentioned in aws/aws-sam-cli#3661 (comment)

Environment:

  • Python version: 3.9
  • Jinja version: Log didn't say, probably your latest stable release
@pllim
Copy link
Author

pllim commented Feb 18, 2022

p.s. I saw pallets/markupsafe#286 but the resolution is unclear to me.

@davidism
Copy link
Member

Duplicate of #1585

You are using an unsupported version of Jinja, please update to the latest version. 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.

@pllim
Copy link
Author

pllim commented Feb 18, 2022

How is pip pulling in unsupported version from PyPI? jinja2 isn't a direct dependency. Can you please clarify? Thanks!

@pllim
Copy link
Author

pllim commented Feb 18, 2022

Nvm, we found it pinned in some upstream pyproject.toml . Thanks for your time.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants