Site not creating

bench new-site dev
MySQL root password:
Restoring Database file…
11.9KiB 0:00:00 [ 374MiB/s] [====================================================================================>] 100%

Installing frappe…
Updating DocTypes for frappe : [============= ] 34%Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 205, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 981, in get_module
return importlib.import_module(modulename)
File “/home/ubuntu/frappe-bench/env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/doctype/web_page/web_page.py”, line 10, in
from jinja2.exceptions import TemplateSyntaxError
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/jinja2/init.py”, line 12, in
from .environment import Environment
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/jinja2/environment.py”, line 25, in
from .defaults import BLOCK_END_STRING
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/jinja2/defaults.py”, line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/jinja2/filters.py”, line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name ‘soft_unicode’ from ‘markupsafe’ (/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/markupsafe/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 38, in new_site
_new_site(db_name, site, mariadb_root_username=mariadb_root_username,
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 81, in _new_site
install_app(app, verbose=verbose, set_as_patched=not source_sql)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 162, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/sync.py”, line 70, in sync_for
import_file_by_path(doc_path, force=force, ignore_version=True, reset_permissions=reset_permissions)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 130, in import_file_by_path
import_doc(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 257, in import_doc
doc.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 270, in insert
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1004, in run_post_save_methods
self.run_method(“on_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 869, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1161, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1144, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 863, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 326, in on_update
self.run_module_method(“on_doctype_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 380, in run_module_method
module = load_doctype_module(self.name, self.module)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 207, in load_doctype_module
raise ImportError(‘Module import failed for {0} ({1})’.format(doctype, module_name + ’ Error: ’ + str(e)))
ImportError: Module import failed for Web Page (frappe.website.doctype.web_page.web_page Error: cannot import name ‘soft_unicode’ from ‘markupsafe’ (/home/ubuntu/frappe-bench/env/lib/python3.8/site-packages/markupsafe/init.py))

Hi,

Is this the first site to be installed or have sites already been created successfully?
try: bench setup requirements, and try again.

this has something to do with markupsafe version.

A work around for this is try going to frappe in the apps folder and open the requirements.txt file.
then add this line
markupsafe==2.0.1
then try running in your terminal
bench setup requirements.

check this out i have managed to solve using this