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' #41

Closed
sankalp-wns opened this issue Feb 18, 2022 · 3 comments
Closed

Comments

@sankalp-wns
Copy link

sankalp-wns commented Feb 18, 2022

The action was working fine till last night and has suddenly started throwing errors.

Below is the log.

Traceback (most recent call last):
  File "/home/runner/work/_temp/setup-sam-2S4sF4/bin/sam", line 8, in <module>
    sys.exit(cli())
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 8[29](https://github.com/***/***/runs/5243409939?check_suite_focus=true#step:5:29), in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 166, in wrapped
    raise exception  # pylint: disable=raising-bad-type
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 124, in wrapped
    return_value = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/utils/version_checker.py", line 41, in wrapped
    actual_result = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/cli/main.py", line 87, in wrapper
    return func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 174, in cli
    do_cli(
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 220, in do_cli
    from samcli.commands.build.build_context import BuildContext
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/commands/build/build_context.py", line 13, in <module>
    from samcli.lib.providers.sam_api_provider import SamApiProvider
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/providers/sam_api_provider.py", line 6, in <module>
    from samcli.lib.providers.api_collector import ApiCollector
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/lib/providers/api_collector.py", line 10, in <module>
    from samcli.local.apigw.local_apigw_service import Route
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/samcli/local/apigw/local_apigw_service.py", line 11, in <module>
    from flask import Flask, request
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F[40](https://github.com/***/***/runs/5243409939?check_suite_focus=true#step:5:40)1
  File "/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/runner/work/_temp/setup-sam-2S4sF4/.venv/lib/python3.10/site-packages/markupsafe/__init__.py)

The usage:

steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1

      - name: Build resources
        run: sam build --template template.yaml --use-container
@Tyler-The-Creator
Copy link

Tyler-The-Creator commented Feb 18, 2022

I'm having the same issue and I'm using Python 3.8.

Usage:

steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1

      - name: Deploy
         run: | 
           sam build && sam deploy --config-file ./samconfig.toml --config-env <env> --no-fail-on-empty-changeset

@galigalikun
Copy link

aws/aws-sam-cli#3661

        - uses: aws-actions/setup-sam@v1
           with:
             version: 1.37.0

@hoffa
Copy link
Contributor

hoffa commented Feb 19, 2022

Thanks for reporting this! The issue has been fixed on the SAM CLI side (see aws/aws-sam-cli#3661).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants