Creating site error cannot import name 'soft_unicode' from 'markupsafe'

Hello Guys,
I faced issue when I tried to create a site
I typed ‘sudo bench setup production (user_name)’

Then I got this issue
cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)

also

I tried
’ bench setup requirements’

I got this error

use command

env/bin/pip install MarkupSafe==2.1.1

and also

env/bin/pip install Jinja2==3.1.2

in your erp directory like
frappe-bench

I solved the issue, it was because of python3.10
my ubuntu was 20.04
I upgraded ubuntu to 22 and it solved
thank you