Basic Command Bench init frappe-bench for init the development on M1 MacOS

Hi guys, Just started working on the frappe

(frappe_bench) ➜  frappe_bench bench init .           
ERROR: Bench instance already exists at .
(frappe_bench) ➜  frappe_bench bench init frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /Users/victor/Documents/dev/frappe_bench/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /Users/victor/Documents/dev/frappe_bench/frappe-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone https://github.com/frappe/frappe.git  --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 3142, done.
remote: Counting objects: 100% (3142/3142), done.
remote: Compressing objects: 100% (2819/2819), done.
remote: Total 3142 (delta 429), reused 1288 (delta 227), pack-reused 0
Receiving objects: 100% (3142/3142), 15.90 MiB | 10.50 MiB/s, done.
Resolving deltas: 100% (429/429), done.
Installing frappe
$ /Users/victor/Documents/dev/frappe_bench/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /Users/victor/Documents/dev/frappe_bench/frappe-bench/apps/frappe 
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      /Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /Users/victor/Documents/dev/frappe_bench/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 "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/setup.py", line 10, in <module>
          setup(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 96, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 104, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 148, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/.eggs/cffi-1.15.1-py3.10-macosx-11.1-arm64.egg/cffi-1.15.1.dist-info' -> '/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/.eggs/cffi-1.15.1-py3.10-macosx-11.1-arm64.egg/EGG-INFO'
      [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: subprocess-exited-with-error
  
  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      /Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /Users/victor/Documents/dev/frappe_bench/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 "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/setup.py", line 10, in <module>
          setup(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 96, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 104, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/victor/Documents/dev/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/setuptools/wheel.py", line 148, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/.eggs/cffi-1.15.1-py3.10-macosx-11.1-arm64.egg/cffi-1.15.1.dist-info' -> '/private/var/folders/jd/9pmzdgzj4cx0m4d2r0qhjknh0000gn/T/pip-install-0q3si04x/cairocffi_370ac34f6171431ebe0cc3596a9e2d52/.eggs/cffi-1.15.1-py3.10-macosx-11.1-arm64.egg/EGG-INFO'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for cairocffi
  DEPRECATION: cairocffi was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. pip 23.1 will enforce this behaviour change. A possible replacement is to fix the wheel build issue reported above. Discussion can be found at https://github.com/pypa/pip/issues/8368
$ yarn install
Traceback (most recent call last):
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/commands/make.py", line 68, in init
    init(
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/utils/system.py", line 79, in init
    get_app(
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/app.py", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/app.py", line 242, in install
    install_app(
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/app.py", line 581, in install_app
    bench.run("yarn install", cwd=app_path)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/site-packages/bench/utils/__init__.py", line 154, in exec_cmd
    return_code = subprocess.call(cmd, cwd=cwd, universal_newlines=True, env=env)
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/subprocess.py", line 345, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/victor/miniconda3/envs/frappe_bench/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'yarn'

Tried everything from

brew install Cmake

And serach for couple days

The error says it can’t find yarn. Make sure it’s installed and in PATH.

https://frappeframework.com/docs/v14/user/en/installation#pre-requisites

Already did for the 2nd run with nvm use 16

Same thing, thanks for the help

Hi @Victor_Tong
I am also facing the same issue, could you please help me on how to resolve this issue.

ERROR: There was a problem while creating frappe-bench

I have successfully installed it on my MacOS.

To solve the “Python setup.py bdist_wheel did not run successfully” error, run the pip install cmake command and make sure you have the wheel, setuptools and pip packages installed and upgraded

Hi @Suresh_Thakor ,

After run this command “pip install cmake”, I run “bench init frappe-bench” again getting an error like below, so please help me to solve this issue.

ERROR: There was a problem while creating frappe-bench

Hi @Suresh_Thakor

But i have installed this "cairocffi "
Package Version


altgraph 0.17.3
ansible 7.4.0
ansible-core 2.14.4
attrs 23.1.0
cairocffi 1.5.1
certifi 2022.6.15
cffi 1.15.1
charset-normalizer 2.1.0
click 8.1.3
cmake 3.26.3
coverage 7.2.3
cryptography 40.0.2
distlib 0.3.5
exceptiongroup 1.1.1
filelock 3.7.1
frappe-bench 5.16.2
gitdb 4.0.10
gitdb2 2.0.6
GitPython 3.1.31
googlemaps 4.10.0
honcho 1.1.0
hypothesis 6.72.1
idna 3.3
iniconfig 2.0.0
Jinja2 3.0.3
macholib 1.16.2
MarkupSafe 2.1.1
numpy 1.24.2
packaging 23.1
pbr 5.9.0
pip 23.1
platformdirs 2.5.2
pluggy 1.0.0
psutil 5.9.5
pycparser 2.21
pyinstaller 5.7.0
pyinstaller-hooks-contrib 2022.14
pytest 7.3.1
pytest-arraydiff 0.5.0
pytest-astropy 0.10.0
pytest-astropy-header 0.2.2
pytest-cov 4.0.0
pytest-doctestplus 0.12.1
pytest-filter-subpackage 0.1.2
pytest-mock 3.10.0
pytest-openfiles 0.5.0
pytest-remotedata 0.4.0
python-crontab 2.6.0
python-dateutil 2.8.2
PyYAML 6.0
requests 2.28.1
resolvelib 0.8.1
semantic-version 2.8.5
setuptools 67.7.0
six 1.16.0
smmap 5.0.0
smmap2 3.0.1
sortedcontainers 2.4.0
SQLAlchemy 1.4.44
stevedore 4.0.0
tomli 2.0.1
urllib3 1.26.11
virtualenv 20.16.3
virtualenv-clone 0.5.7
virtualenvwrapper 4.8.4
Werkzeug 2.2.3
wheel 0.40.0