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 egg_info did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/ SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/”, line 10, in
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/”, line 153, in setup
return distutils.core.setup(**attrs)
File “/usr/lib/python3.10/distutils/”, line 108, in setup
_setup_distribution = dist = klass(attrs)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/”, line 459, in init
File “/usr/lib/python3.10/distutils/”, line 292, in init
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/”, line 837, in finalize_options
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/setuptools/”, line 858, in _finalize_setup_keywords
ep.load()(self,, value)
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/”, 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/”, 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/”, line 25, in execfile
exec(code, glob, glob)
File “cairocffi/”, line 26, in
ffi = FFI()
File “/tmp/pip-install-qp99aqvf/cairocffi_ee013df79cae4892a7217e212cd917ef/.eggs/cffi-1.15.1-py3.10-linux-x86_64.egg/cffi/”, 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/ 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/”, line 68, in init
File “/usr/local/lib/python3.10/dist-packages/bench/utils/”, line 105, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/”, line 79, in init
File “/usr/local/lib/python3.10/dist-packages/bench/”, 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/”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/”, line 242, in install
File “/usr/local/lib/python3.10/dist-packages/bench/”, line 573, in install_app
File “/usr/local/lib/python3.10/dist-packages/bench/”, 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/”, line 158, in exec_cmd
raise 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.