I get this error during installation.please help me

[frappe@iZd7o9ocmvfhf0g4hliy3iZ frappe-bench]$ bench get-app --branch version-12 erpnext
A directory for the application ‘erpnext’ already exists. Do you want to continue and overwrite it? [y/N]: y
Getting erpnext
$ git clone GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --origin upstream
Cloning into ‘erpnext’…
remote: Enumerating objects: 435706, done.
remote: Counting objects: 100% (10/10), done.
remote: Total 435706 (delta 9), reused 9 (delta 9), pack-reused 435696
Receiving objects: 100% (435706/435706), 1011.98 MiB | 11.57 MiB/s, done.
Resolving deltas: 100% (300502/300502), done.
Installing erpnext
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/erpnext
ERROR: Command errored out with exit status 1:
command: /home/frappe/frappe-bench/env/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d /tmp/pip-wheel-y_zn08ux
cwd: /tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/
Complete output (23 lines):
You are running without Cython installed. It is highly recommended to run
pip install cython>=0.29.21,<1.0.0
before you continue
/home/frappe/frappe-bench/env/lib/python3.6/site-packages/setuptools/init.py:151: SetuptoolsDeprecationWarning: setup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.
SetuptoolsDeprecationWarning,
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/jsonobject
copying jsonobject/exceptions.py → build/lib.linux-x86_64-3.6/jsonobject
copying jsonobject/init.py → build/lib.linux-x86_64-3.6/jsonobject
running build_ext
building ‘jsonobject.api’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/jsonobject
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/frappe/frappe-bench/env/include -I/usr/include/python3.6m -c jsonobject/api.c -o build/temp.linux-x86_64-3.6/jsonobject/api.o
jsonobject/api.c:16:20: fatal error: Python.h: No such file or directory
#include “Python.h”
^
compilation terminated.
error: command ‘gcc’ failed with exit status 1

ERROR: Failed building wheel for jsonobject
ERROR: Command errored out with exit status 1:
command: /home/frappe/frappe-bench/env/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record /tmp/pip-record-u66g2sf3/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe-bench/env/include/site/python3.6/jsonobject
cwd: /tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/
Complete output (25 lines):
You are running without Cython installed. It is highly recommended to run
pip install cython>=0.29.21,<1.0.0
before you continue
/home/frappe/frappe-bench/env/lib/python3.6/site-packages/setuptools/init.py:151: SetuptoolsDeprecationWarning: setup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.
SetuptoolsDeprecationWarning,
running install
/home/frappe/frappe-bench/env/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/jsonobject
copying jsonobject/exceptions.py → build/lib.linux-x86_64-3.6/jsonobject
copying jsonobject/init.py → build/lib.linux-x86_64-3.6/jsonobject
running build_ext
building ‘jsonobject.api’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/jsonobject
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/frappe/frappe-bench/env/include -I/usr/include/python3.6m -c jsonobject/api.c -o build/temp.linux-x86_64-3.6/jsonobject/api.o
jsonobject/api.c:16:20: fatal error: Python.h: No such file or directory
#include “Python.h”
^
compilation terminated.
error: command ‘gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/frappe/frappe-bench/env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '”‘"’/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-avot9d87/jsonobject_e060a208558f424393edd9f55d6a0981/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record /tmp/pip-record-u66g2sf3/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe-bench/env/include/site/python3.6/jsonobject Check the logs for full command output.
ERROR:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.6/site-packages/bench/cli.py”, line 117, in cli
raise e
File “/usr/local/lib/python3.6/site-packages/bench/cli.py”, line 107, in cli
bench_command()
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/bench/commands/make.py”, line 147, in get_app
init_bench=init_bench,
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 357, in get_app
app.install(verbose=verbose, skip_assets=skip_assets)
File “/usr/local/lib/python3.6/site-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 189, in install
app=app_name, bench_path=self.bench.name, verbose=verbose, skip_assets=skip_assets,
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 408, in install_app
bench.run(f”{bench.python} -m pip install {quiet_flag} --upgrade -e {app_path} {cache_flag}")
File “/usr/local/lib/python3.6/site-packages/bench/bench.py”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.6/site-packages/bench/utils/init.py”, line 126, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

Hi,

May we know what method of installation is being followed and the operating environment ?

centos 7.6

try: sudo yum install python36.devel python36.Cython, then try again

[root@iZd7o9ocmvfhf0g4hliy3iZ ~]# sudo yum install python36.devel python36.Cython
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package python36.devel available.
No package python36.Cython available.
Error: Nothing to do

what does python3 -V return?

[root@iZd7o9ocmvfhf0g4hliy3iZ ~]# python3 -V
Python 3.6.8

Try yum install python3-devel python3-Cython

Thank you!
Above problem is solved now this error I get.

Installing erpnext…
An error occurred while installing erpnext:
Module import failed for Purchase Invoice (erpnext.accounts.doctype.purchase_invoice.purchase_invoice Error: cannot import name ‘clear_cache’)

Installing erpnext…
An error occurred while installing erpnext:
(‘Module Def’, ‘Accounts’, IntegrityError(1062, “Duplicate entry ‘Accounts’ for key ‘PRIMARY’”))

what does bench version report at this point?

erpnext 13.x.x-develop
frappe 12.24.0

If you are trying to install ERPNext version 12 to a new site then uninstall the app, drop the site and install version 12 to a new site.

If you are trying to update a version 12 site to 13 then the switch-to-version option can be tried : bench switch-to-branch version-13 frappe erpnext --upgrade

I have almost the same error:
Installing frappe
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe
ERROR: Command errored out with exit status 1:
command: /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_editable /tmp/tmp6pxm1uf9
cwd: /home/frappe/frappe-bench/apps/frappe
Complete output (17 lines):
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py”, line 363, in
main()
File “/home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py”, line 345, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
File “/home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py”, line 144, in get_requires_for_build_editable
return hook(config_settings)
File “/tmp/pip-build-env-tqhohlo5/overlay/lib/python3.6/site-packages/flit_core/buildapi.py”, line 32, in get_requires_for_build_wheel
docstring, version = get_docstring_and_version_via_ast(module)
File “/tmp/pip-build-env-tqhohlo5/overlay/lib/python3.6/site-packages/flit_core/common.py”, line 149, in get_docstring_and_version_via_ast
node = ast.parse(f.read())
File “/usr/lib64/python3.6/ast.py”, line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File “”, line 1131
if (key := can_cache_doc(args)) and (doc := cache.get_value(key)):
^
SyntaxError: invalid syntax

WARNING: Discarding file:///home/frappe/frappe-bench/apps/frappe. Command errored out with exit status 1: /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.pyget_requires_for_build_editable /tmp/tmp6pxm1uf9 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/lib64/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_editable /tmp/tmp6pxm1uf9 Check thelogs for full command output.
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/bench/commands/make.py”, line 83, in init
verbose=verbose,
File “/usr/local/lib/python3.6/site-packages/bench/utils/render.py”, line 95, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/bench/utils/system.py”, line 85, in init
resolve_deps=False,
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 433, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.6/site-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 239, in install
resolution=self.local_resolution
File “/usr/local/lib/python3.6/site-packages/bench/app.py”, line 553, in install_app
bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade -e {app_path} {cache_flag}")
File “/usr/local/lib/python3.6/site-packages/bench/bench.py”, line 47, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.6/site-packages/bench/utils/init.py”, line 153, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

Hi,

May we know what method of installation is being followed and the operating environment ? This thread is quite dated and refers to versions of Frappe and ERPNext that are no longer active.