-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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' in Release 1.38.0 #3661
Comments
Looks the issue is due to upgrade in
|
I tried to change the version of sam to 1.29.0 in github actions using this action, seemslike it still download the newest version of Markupsafe |
same here - seems MarkUoSafe was updated and there is no soft_unicode there any more. How to solve this?
pip install --user --upgrade aws-sam-cli - gets last version on Jijnja Collecting Jinja2<4.0.0,>=2.7 yesterday was |
@SamkeetJainMensa, thanks lot, it's working with 1.37.0, I did this change in gitaction
|
@sthadapradit this I did, but it is temproary solution - any idea how to come back to |
Looks like a breaking change in |
I'm getting the same error with "SAM CLI, version 1.37.0". I have not upgraded. |
I had this issue with Django using Jinja2. Jinja2 imports |
Downgrading markupsafe to 2.0.1 fixes the issue on my side. |
aws-sam-cli is using an unsupported version of Jinja, they need to update to the latest version. Additionally, they need to read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin their dependencies to control when their users get updates. Be sure to run tests with deprecation warnings treated as errors so that these types of changes show up early. |
* fix issue * test and build in CI * minor * typo * fix for aws/aws-sam-cli#3661 * exec permission for container-release.sh * multi-arch docker image build required
Looking into this. Though this is why we do not recommend using pip to install and instead use our installers. @davidism We are stuck in a place that if we pin, customers get upset that they can install with all their other tools (in a single interpreter instead of isolating). If we don't pin (everything), we run into this things. So it's a who do we block/make angry situation. Would be great if python (pip) actually solved this instead of each tool having to battle users on how to install or providing ways tools can vend safely through pip. |
Just ran into this issue installing with easy fix if anyone else sees this though, setup-sam allows you to set version
|
Update 05.use-cases-c.md
Thanks for reporting this issue. SAM CLI v1.38.1 is released which contains the fix for it. As @jfuss mentioned, we would highly recommend using our installers (NativeInstaller for Linux, brew for MacOS and MSI for Windows). Resolving the issue. |
Pins the version to 2.0.1. aws/aws-sam-cli#3661 (comment)
thankyou, it works |
下記と同じようにImportErrorが発生したため aws/aws-sam-cli#3661
Pinning markupsafe, see aws/aws-sam-cli#3661
### What changes were proposed in this pull request? This PR proposes to pin the Python package `markupsafe` to 2.0.1 to fix the CI failure as below. ``` ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/runner/work/_temp/setup-sam-43osIE/.venv/lib/python3.10/site-packages/markupsafe/__init__.py) ``` Since `markupsafe==2.1.0` has removed `soft_unicode`, `from markupsafe import soft_unicode` no longer working properly. See aws/aws-sam-cli#3661 for more detail. ### Why are the changes needed? To fix the CI failure on branch-3.2 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? The existing tests are should be passed Closes apache#35602 from itholic/SPARK-38279. Authored-by: itholic <haejoon.lee@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
refer to aws/aws-sam-cli#3661 for similar issue
refer to aws/aws-sam-cli#3661 for similar issue
Thanks a lot. |
Fix issue aws/aws-sam-cli#3661 Downgrade markupsafe to 2.0.1
Add the constraint of markupsafe version to 2.0.1, according to the ref: aws/aws-sam-cli#3661 (comment)
Add the constraint of markupsafe version to 2.0.1, according to the ref: aws/aws-sam-cli#3661 (comment) Add a snapshot of version 2.2.3's Dockerfile
Add the constraint of markupsafe version to 2.0.1, according to the ref: aws/aws-sam-cli#3661 (comment) Add a snapshot of version 2.2.3's Dockerfile
thank you. |
I'm building the sam project on github action and since the upgrade of sam-cli to 1.38.0, i'm getting following error when i build project
Python version:
3.10.2
&3.8.12
(Tried both versions)Pip version:
pip-22.0.3
Sam cli version:
1.38.0
Command:
sam build --template ${SAM_TEMPLATE} --use-container
Trace:
I revert sam-cli version to
1.37.0
and it worked perfectly.The text was updated successfully, but these errors were encountered: