Error Trying to Install ERPNext

Hi,

I keep encountering the error below while trying to install ERPNext on a new bench:

Installing erpnext
$ ./env/bin/pip install -q -U -e ./apps/erpnext
  ERROR: Command errored out with exit status 1:
   command: /home/frappe/frappe-bench1/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-rtkc_bqa
       cwd: /tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/
  Complete output (22 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
  Warning: 'classifiers' should be a list, got type 'tuple'
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/jsonobject
  copying jsonobject/exceptions.py -> build/lib.linux-x86_64-3.7/jsonobject
  copying jsonobject/__init__.py -> build/lib.linux-x86_64-3.7/jsonobject
  running build_ext
  building 'jsonobject.api' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/jsonobject
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/frappe/frappe-bench1/env/include -I/usr/include/python3.7m -c jsonobject/api.c -o build/temp.linux-x86_64-3.7/jsonobject/api.o
  jsonobject/api.c:16:10: fatal error: Python.h: No such file or directory
     16 | #include "Python.h"
        |          ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for jsonobject
    ERROR: Command errored out with exit status 1:
     command: /home/frappe/frappe-bench1/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mqw4fu_2/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe-bench1/env/include/site/python3.7/jsonobject
         cwd: /tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/
    Complete output (22 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
    Warning: 'classifiers' should be a list, got type 'tuple'
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/jsonobject
    copying jsonobject/exceptions.py -> build/lib.linux-x86_64-3.7/jsonobject
    copying jsonobject/__init__.py -> build/lib.linux-x86_64-3.7/jsonobject
    running build_ext
    building 'jsonobject.api' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/jsonobject
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/frappe/frappe-bench1/env/include -I/usr/include/python3.7m -c jsonobject/api.c -o build/temp.linux-x86_64-3.7/jsonobject/api.o
    jsonobject/api.c:16:10: fatal error: Python.h: No such file or directory
       16 | #include "Python.h"
          |          ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/frappe/frappe-bench1/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n13wu_7k/jsonobject_1f4cab88d1bd4a7da49228d9590b60d2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mqw4fu_2/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe-bench1/env/include/site/python3.7/jsonobject Check the logs for full command output.
WARNING: You are using pip version 21.0.1; however, version 21.2.4 is available.
You should consider upgrading via the '/home/frappe/frappe-bench1/env/bin/python -m pip install --upgrade pip' command.
$ yarn install
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'
$ bench build --app erpnext
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Traceback (most recent call last):
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/utils/bench_helper.py", line 70, in get_app_commands
    app_command_module = importlib.import_module(app + '.commands')
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'erpnext'
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
    main()
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench1/env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/commands/utils.py", line 34, in build
    frappe.init('')
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/__init__.py", line 210, in init
    setup_module_map()
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/__init__.py", line 1120, in setup_module_map
    for module in get_module_list(app):
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/__init__.py", line 988, in get_module_list
    return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), "modules.txt"))
  File "/home/frappe/frappe-bench1/apps/frappe/frappe/__init__.py", line 946, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'erpnext'

Any ideas on how to resolve this?

Kind regards

Hi,

Can you say what instructions you are following to install bench/frappe/ERPNext?

This link may help, as it may be that some dependencies have not been installed.

https://github.com/frappe/frappe/wiki/The-Hitchhiker%27s-Guide-to-Installing-Frappe-on-Linux

Hi @smino

Thanks for your response. I tried following the guide but now I’m encountering an error when trying to create the bench!

venv: error: unrecognized arguments: -q -p python3

Any ideas ?

Okay, so I fixed this by reinstalling virtualenv but the main error I outlined above still persists!

Any suggestions will be greatly appreciated

Thanks

bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch version-13

So I discovered I had solved this particular issue before ModuleNotFoundError: No module named 'erpnext' centos7

I however am now encountering an issue with downloading assets: The site isn’t displaying properly but running bench build throws the following error:

frappe@ip-172-31-58-151:~/frappe-bench$ bench build
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

An Error occurred while downloading assets...
✔ Application Assets Linked

00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'

Any ideas pls ?

So, did you?

HI @rtdany10

Thanks a lot for responding. I actually solved that by using the solution earlier referenced

1 Like

Solved it by reinstalling yarn… phew! :sweat_smile:

1 Like

@wale how did you solve this issue i.e.

venv: error: unrecognized arguments: -q -p python3

can you please share exact steps…‘i fixed this by reinstalling virtualenv’
i have been hang on this for 2 days with no luck
thanks!