Facing issues in frappe develop bench local setup

While trying to setup develop bench in local getting the following error:

~/frappe-bench-list$ bench init dev-bench --frappe-branch develop
Setting Up Environment
$ python3 -m venv env
$ /home/vimal/frappe-bench-list/dev-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /home/vimal/frappe-bench-list/dev-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone https://github.com/frappe/frappe.git --branch develop --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 3320, done.
remote: Counting objects: 100% (3320/3320), done.
remote: Compressing objects: 100% (2923/2923), done.
remote: Total 3320 (delta 511), reused 1502 (delta 302), pack-reused 0 (from 0)
Receiving objects: 100% (3320/3320), 15.28 MiB | 2.78 MiB/s, done.
Resolving deltas: 100% (511/511), done.
Installing frappe
$ /home/vimal/frappe-bench-list/dev-bench/env/bin/python -m pip install --quiet --upgrade -e /home/vimal/frappe-bench-list/dev-bench/apps/frappe 
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Trying pkg-config --exists mysqlclient
      Command 'pkg-config --exists mysqlclient' returned non-zero exit status 1.
      Trying pkg-config --exists mariadb
      Command 'pkg-config --exists mariadb' returned non-zero exit status 1.
      Trying pkg-config --exists libmariadb
      Command 'pkg-config --exists libmariadb' returned non-zero exit status 1.
      Trying pkg-config --exists perconaserverclient
      Command 'pkg-config --exists perconaserverclient' returned non-zero exit status 1.
      Traceback (most recent call last):
        File "/home/vimal/frappe-bench-list/dev-bench/env/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/vimal/frappe-bench-list/dev-bench/env/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/vimal/frappe-bench-list/dev-bench/env/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-1tdt_yrp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-1tdt_yrp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-1tdt_yrp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 156, in <module>
        File "<string>", line 49, in get_config_posix
        File "<string>", line 28, in find_package_name
      Exception: Can not find valid pkg-config name.
      Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
subprocess.CalledProcessError: Command '/home/vimal/frappe-bench-list/dev-bench/env/bin/python -m pip install --quiet --upgrade -e /home/vimal/frappe-bench-list/dev-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.12/dist-packages/bench/commands/make.py", line 75, in init
    init(
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/system.py", line 87, in init
    get_app(
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 778, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 253, in install
    install_app(
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 912, in install_app
    bench.run(
  File "/usr/local/lib/python3.12/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.12/dist-packages/bench/utils/__init__.py", line 181, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: /home/vimal/frappe-bench-list/dev-bench/env/bin/python -m pip install --quiet --upgrade -e /home/vimal/frappe-bench-list/dev-bench/apps/frappe 

ERROR: There was a problem while creating dev-bench
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench "dev-bench"

Can anyone help me with this issue? Thank you.

Frappe: develop
OS: Linux Mint 22.1 (Based on Ubuntu 24.04)
Python: 3.12.3

Note: This issue is occuring only in the develop branch. The version-15 branch is working fine.

Hi ,

It may help to describe the instructions that were followed used to install Frappe.

Solved the issue by installing the following:

sudo apt-get install libmysqlclient-dev
sudo apt-get install libmariadb-dev