- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
install the dependent packages in a virtual environment
cd <project-root-directory> # the folder into which you cloned the code
python3 -m venv venv # only required if you don't have a venv already
source venv/bin/activate
pip install -r requirements.txt
run the app on Linux
. .\run.flask.dev.ps1
Any log messages given by the failure
Traceback (most recent call last):
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/bin/flask", line 5, in <module>
from flask.cli import main
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module>
from jinja2 import escape
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
from .environment import Environment
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
from .defaults import BLOCK_END_STRING
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/prac-msgraph/ms-identity-python-flask-webapp-authentication/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' (/prac-msgraph/ms-identity-python-flask-webapp-authentication/venv/lib/python3.8/site-packages/markupsafe/__init__.py)
Expected/desired behavior
The app could start succeessfully
OS and Version
Ubuntu Linux 20.04
Mention any other details that might be useful
I found the MarkupSafe package installed is of version 2.1.1. After downgrading it to version 2.0.1 and restart the app, it works!
I hit the same issue. Indeed, downgrading 'markupsafe' to 2.0.1 seems to solve it.
Found this URL where it's also explained why the ImportError occurs with markupsafe >= 2.1.1: the soft_unicode method was already deprecated and was removed in 2.1.1 (also see here).
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
The app could start succeessfully
OS and Version
Ubuntu Linux 20.04
Mention any other details that might be useful
I found the MarkupSafe package installed is of version
2.1.1
. After downgrading it to version2.0.1
and restart the app, it works!