D-codE-Hub / Frappe-ERPNext-Version-15--in-Ubuntu-22.04-LTS

Frappe-ERPNext-Version-15--in-Ubuntu-22.04-LTS
38 stars 29 forks source link

bench init frappe-bench: Building wheel for cairocffi (pyproject.toml) did not run successfully. (Ubuntu 22.04, ERPnext v15) #5

Open neosec-eu opened 2 weeks ago

neosec-eu commented 2 weeks ago

Moin!

Bench 5.22.6

Python 3.11.9

For installing bench on Ubuntu 22.04 LTS I used the instruction: https://github.com/D-codE-Hub/Frappe-ERPNext-Version-15--in-Ubuntu-22.04-LTS

Unfortunately I constantly run into trouble:

Setting Up Environment
$ python3.11 -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 https://github.com/frappe/frappe.git --branch version-15 --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 3308, done.
remote: Counting objects: 100% (3308/3308), done.
remote: Compressing objects: 100% (2976/2976), done.
remote: Total 3308 (delta 413), reused 1524 (delta 218), pack-reused 0
Receiving objects: 100% (3308/3308), 15.57 MiB | 12.04 MiB/s, done.
Resolving deltas: 100% (413/413), 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

  × Building wheel for cairocffi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/home/frappe/frappe-bench/env/bin/pip", line 5, in <module>
          from pip._internal.cli.main import main
      ModuleNotFoundError: No module named 'pip'
      Traceback (most recent call last):
        File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-5b5kvoam/cairocffi_3444dc105e474c02a264b0fc0aeb3e00/utils/build.py", line 30, in build_wheel
          spec.loader.exec_module(module)
        File "<frozen importlib._bootstrap_external>", line 940, in exec_module
        File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
        File "/tmp/pip-install-5b5kvoam/cairocffi_3444dc105e474c02a264b0fc0aeb3e00/cairocffi/ffi_build.py", line 29, in <module>
          ffi = FFI()
                ^^^^^
        File "/tmp/pip-build-env-8hc9sp9m/overlay/lib/python3.11/site-packages/cffi/api.py", line 48, in __init__
          import _cffi_backend as backend
      ImportError: /tmp/pip-build-env-8hc9sp9m/overlay/lib/python3.11/site-packages/_cffi_backend.cpython-311-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: Failed building wheel for cairocffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cairocffi)
subprocess.CalledProcessError: Command '/home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe ' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/bench/commands/make.py", line 75, in init
    init(
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/system.py", line 87, in init
    get_app(
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 777, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 254, in install
    install_app(
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 909, in install_app
    bench.run(
  File "/usr/local/lib/python3.11/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.11/dist-packages/bench/utils/__init__.py", line 178, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe 

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

I tried to manually install

pip3 install cffi
pip3 install cairocffi

with no luck.

I always end up with:

ERROR: Failed building wheel for cairocffi

neosec-eu commented 2 weeks ago

Fixed! The only change I had to made was:

Not using

bench init frappe-bench --frappe-branch version-15 --python python3.11

but

bench init frappe-bench