Error when running bench init --frappe-branch version-14 frappe-bench on a2 hosting vps

frappe@rtos:~$ bench init --frappe-branch version-14 frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch version-14 --depth 1 --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 3164, done.
remote: Counting objects: 100% (3164/3164), done.
remote: Compressing objects: 100% (2839/2839), done.
remote: Total 3164 (delta 426), reused 1258 (delta 226), pack-reused 0
Receiving objects: 100% (3164/3164), 15.99 MiB | 10.56 MiB/s, done.
Resolving deltas: 100% (426/426), done.
Installing frappe
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/setup.py”, line 10, in
setup(
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/init.py”, line 153, in setup
return distutils.core.setup(**attrs)
File “/usr/lib/python3.10/distutils/core.py”, line 108, in setup
_setup_distribution = dist = klass(attrs)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py”, line 459, in init
_Distribution.init(
File “/usr/lib/python3.10/distutils/dist.py”, line 292, in init
self.finalize_options()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py”, line 837, in finalize_options
ep(self)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py”, line 858, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/setuptools_ext.py”, line 219, in cffi_modules
add_cffi_module(dist, cffi_module)
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/setuptools_ext.py”, line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/setuptools_ext.py”, line 25, in execfile
exec(code, glob, glob)
File “cairocffi/ffi_build.py”, line 26, in
ffi = FFI()
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/api.py”, line 48, in init
import _cffi_backend as backend
ImportError: /tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/_cffi_backend.cpython-310-x86_64-linux-gnu.so: failed to map segment from shared object
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/bench/commands/make.py”, line 68, in init
init(
File “/usr/local/lib/python3.10/dist-packages/bench/utils/render.py”, line 105, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/system.py”, line 79, in init
get_app(
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 444, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 242, in install
install_app(
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 573, in install_app
bench.run(
File “/usr/local/lib/python3.10/dist-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 158, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [y/N]: y

Were you able to solve this. I am getting the same error but not on a2.