question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hello.

Using jinja2 version is too old, since markupsafe changed his API.

See:

>>> from aiohttp_apispec import setup_aiohttp_apispec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/aiohttp_apispec/__init__.py", line 1, in <module>
    from .aiohttp_apispec import AiohttpApiSpec, setup_aiohttp_apispec
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/aiohttp_apispec/aiohttp_apispec.py", line 11, in <module>
    from jinja2 import Template
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/mnt/c/Users/akaWolf/venv/lib/python3.8/site-packages/markupsafe/__init__.py)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
maximdanilchenkocommented, Mar 1, 2022

New releases (v2.2.3 and v3.0.0b2) has been released with this fix

0reactions
cheycommented, Feb 25, 2022

need up version jinja2>=3.0.3

It looks like the requirements.txt has already been updated. Once a new release is pushed out it should be good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot import name 'soft_unicode' from 'markupsafe ... - GitHub
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...
Read more >
ImportError: cannot import name 'soft_unicode' from 'markupsafe'
I installed markupsafe 2.0.1 version. Open jupyter notebook. pip uninstall zmq pip install zmq pip install markupsafe==2.0.1 jupyter notebook.
Read more >
cannot import name soft_unicode from markupsafe (Solved)
importerror: cannot import name soft_unicode from markupsafe error occurs because of incompatibility of markupsafe package. This markupsafe python package ...
Read more >
Cannot import name 'soft_unicode' from 'markupsafe' [Solved]
The "ImportError: cannot import name 'soft_unicode' from 'markupsafe'" occurs because the soft_unicode method has been deprecated in markupsafe version 2.1.0.
Read more >
cannot import name 'soft_unicode' from 'markupsafe' jinja2
ImportError : cannot import name 'soft_unicode' from 'markupsafe' (C:\Users\NXHSE\AppData\Roaming\Python\Python39\site-packages\markupsafe_init_.py).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found