Failure to install frappe on local[mac]

Trace -

bench init frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /Users/DeHaat/dehaat-code/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /Users/DeHaat/dehaat-code/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 --depth 1 --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 3249, done.
remote: Counting objects: 100% (3249/3249), done.
remote: Compressing objects: 100% (2734/2734), done.
remote: Total 3249 (delta 500), reused 1652 (delta 402), pack-reused 0
Receiving objects: 100% (3249/3249), 11.39 MiB | 5.54 MiB/s, done.
Resolving deltas: 100% (500/500), done.
Installing frappe
$ /Users/DeHaat/dehaat-code/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /Users/DeHaat/dehaat-code/frappe-bench/apps/frappe
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File “/Users/DeHaat/dehaat-code/frappe-bench/env/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 353, in
main()
File “/Users/DeHaat/dehaat-code/frappe-bench/env/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
File “/Users/DeHaat/dehaat-code/frappe-bench/env/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/in_process/in_process.py", line 132, in get_requires_for_build_editable
return hook(config_settings)
File "/private/var/folders/4
/pmk0wyrx3gd6dvrl5f1prx3c0000gp/T/pip-build-env-yhql73pi/overlay/lib/python3.7/site-packages/flit_core/buildapi.py", line 32, in get_requires_for_build_wheel
docstring, version = get_docstring_and_version_via_ast(module)
File "/private/var/folders/4
/pmk0wyrx3gd6dvrl5f1prx3c0000gp/T/pip-build-env-yhql73pi/overlay/lib/python3.7/site-packages/flit_core/common.py”, line 149, in get_docstring_and_version_via_ast
node = ast.parse(f.read())
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ast.py”, line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File “”, line 445
if extra_config := config.get(“extra_config”):
^
SyntaxError: invalid syntax
[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 editable 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 '/Users/DeHaat/dehaat-code/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /Users/DeHaat/dehaat-code/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 “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/commands/make.py”, line 89, in init
dev=dev,
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/utils/render.py”, line 105, in wrapper_fn
return fn(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/utils/system.py”, line 93, in init
resolve_deps=False,
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/app.py”, line 772, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/app.py”, line 263, in install
using_cached=using_cached,
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/app.py”, line 905, in install_app
f"{bench.python} -m pip install {quiet_flag} --upgrade -e {app_path} {cache_flag}"
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bench/utils/init.py”, line 169, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: /Users/DeHaat/dehaat-code/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /Users/DeHaat/dehaat-code/frappe-bench/apps/frappe

I think the main issue is in the Python version, so please check the Pre-requisites according to the version. and also check the step.

Yes, but it is by default pickup 3.9 as the env version while running command-
bench init frappe-bench
but in my ~/.zshrc -

alias python='python3.10'
alias python3='python3.10'

and
python --version also returns 3.10,

can you help here?

Update python3 Symlink:

sudo ln -sf /usr/local/bin/python3.10 /usr/bin/python3

Update $PATH Environment Variable: Add Python 3.10’s directory to your $PATH to ensure the system recognizes the updated symlink.

echo 'export PATH="/usr/local/opt/python@3.10/bin:$PATH"' >> ~/.zshrc

Then check the python version:

python3 --version

Reference for only step.

Getting the following error while trying to create the symlink

sudo ln -sf /usr/local/bin/python3.10 /usr/bin/python3

ln: /usr/bin/python3: Operation not permitted

Try this command for macos

sudo ln -sf /usr/local/bin/python3.10 /usr/local/bin/python3

thanks @cherrycharan and @NCP . this is fixed

@ahsas5 It is out of context but , Is Dehaat trying to introduce Frappe in their Tech Stack?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.