Install from git failed when "bench init frappe-bench" gentoo lxml

Hi
when i instll erpnext from git, i meet this, is there anybody have experience on this, help me please. thanks
here is the message

installing frappe
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
Command “/home/git/erpNEXT/frappe-bench/env/bin/python2 -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-jNZHbz/maxminddb-geolite2/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-8M7agz-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/git/erpNEXT/frappe-bench/env/include/site/python2.7/maxminddb-geolite2” failed with error code 1 in /tmp/pip-build-jNZHbz/maxminddb-geolite2/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/git/erpNEXT/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/home/git/.local/lib64/python3.5/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/git/.local/lib64/python3.5/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/git/.local/lib64/python3.5/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/git/.local/lib64/python3.5/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/git/.local/lib64/python3.5/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/git/erpNEXT/bench-repo/bench/commands/make.py”, line 28, in init
python = python)
File “/home/git/erpNEXT/bench-repo/bench/utils.py”, line 66, in init
get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
File “/home/git/erpNEXT/bench-repo/bench/app.py”, line 76, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/home/git/erpNEXT/bench-repo/bench/app.py”, line 107, in install_app
find_links=find_links))
File “/home/git/erpNEXT/bench-repo/bench/utils.py”, line 142, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir

Welcome to ERPNext Tsingsong_Wang

What install instructions are you following and what OS?

ERPNext runs on python 2.7 - so you will need to use that.

i use the instruction from git page GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps. My system is gentoo, and it is uptodate.
i will try test
#eselect python set python2.7 or is there any otherthing i can do to change the python version?
before “bench init frappe-bench && cd frappe-bench”

I can’t say what your options other than python 2.7 must be present.

frappe@erpnext:~/frappe-bench$ which python
/usr/bin/python
frappe@erpnext:~/frappe-bench$ ls -al /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 21 2013 /usr/bin/python → python2.7

ERPNext uses virtualenv to manage and separate Python 2.7 environments.

The pip manager installs virtualenv, I think.

edit: Here’s a primer Python Virtual Environments: A Primer – Real Python

first of all thank you for your response.
i have tried as what you said,
change the soft link of python in my /usr/bin;
reinstall from the scratch as the git page said,
the first line of virtualenv like this
#!/usr/bin/python2.7
but that massage appear again
it looks like the same as previous but the version of python.
is there any suggestion further ?

git@vhost0 ~/erpNEXT $ bench init frappe-bench && cd frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python2
INFO:bench.utils:./env/bin/pip -q install --upgrade pip
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Counting objects: 140332, done.
remote: Total 140332 (delta 0), reused 0 (delta 0), pack-reused 140332
Receiving objects: 100% (140332/140332), 128.30 MiB | 19.92 MiB/s, done.
Resolving deltas: 100% (105641/105641), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Command "/home/git/erpNEXT/frappe-bench/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dycCnr/maxminddb-geolite2/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-V5Cp2t-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/git/erpNEXT/frappe-bench/env/include/site/python2.7/maxminddb-geolite2" failed with error code 1 in /tmp/pip-build-dycCnr/maxminddb-geolite2/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/git/erpNEXT/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/home/git/.local/lib64/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/git/.local/lib64/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/git/.local/lib64/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/git/.local/lib64/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/git/.local/lib64/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/git/erpNEXT/bench-repo/bench/commands/make.py", line 28, in init
    python               = python)
  File "/home/git/erpNEXT/bench-repo/bench/utils.py", line 66, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/home/git/erpNEXT/bench-repo/bench/app.py", line 76, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/home/git/erpNEXT/bench-repo/bench/app.py", line 107, in install_app
    find_links=find_links))
  File "/home/git/erpNEXT/bench-repo/bench/utils.py", line 142, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir

the last line of output message is bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir i think maybe something is wrong with this command, so i run this command without -q option as frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe --no-cache-dir the output message is

Successfully installed Pillow-5.0.0 PyJWT-1.5.3 PyPDF2-1.26.0 PyYAML-3.12 argh-0.26.2 asn1crypto-0.24.0 babel-2.5.3 backports.csv-1.0.5 backports.shutil-get-terminal-size-1.0.0 beautifulsoup4-4.6.0 bleach-2.1.2 bleach-whitelist-0.0.8 cffi-1.11.4 cli-helpers-1.0.1 click-6.7 configobj-5.0.6 croniter-0.3.20 cryptography-2.1.4 cssselect-1.0.3 cssutils-1.0.2 decorator-4.2.1 dill-0.2.7.1 email-reply-parser-0.5.9 enum34-1.1.6 et-xmlfile-1.0.1 frappe googlemaps-2.5.1 html2text-2016.9.19 html5lib-1.0.1 ipython-5.5.0 ipython-genutils-0.2.0 jdcal-1.3 lxml-4.1.1 maxminddb-geolite2-2017.803 mycli-1.16.0 ndg-httpsclient-0.4.4 num2words-0.5.5 oauthlib-2.0.6 openpyxl-2.5.0 pathlib2-2.3.0 pathtools-0.1.2 pexpect-4.3.1 pickleshare-0.7.4 premailer-3.1.1 prompt-toolkit-1.0.15 ptyprocess-0.5.2 pyasn1-0.4.2 pycparser-2.18 pygments-2.2.0 pyopenssl-17.5.0 pyotp-2.2.6 pypng-0.0.18 pyqrcode-1.2.1 pytz-2017.3 rauth-0.7.3 redis-2.10.6 rq-0.10.0 scandir-1.6 schedule-0.5.0 selenium-3.8.1 semantic-version-2.6.0 simplegeneric-0.8.1 sqlparse-0.2.4 tabulate-0.8.2 terminaltables-3.1.0 traitlets-4.3.2 unittest-xml-reporting-2.1.0 watchdog-0.8.0 wcwidth-0.1.7 webencodings-0.5.1 werkzeug-0.14.1 zxcvbn-python-4.4.19

Be aware that to install ERPNext on Gentoo may require some configuration for that environment.

This guide, that supports Ubuntu, Debian and CentOS, may give you ideas erpnext_admin_guide | ERPNext Administrators Guide

Hi,

I have the same exact problem when trying to install erpnext using the provided method.

Any ideas ? Thanks in advance.

frappe@raspberrypi3:~/bench-repo $ bench init frappe-bench && cd frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:./env/bin/pip -q install --upgrade pip==9.0.3
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --origin upstream
Cloning into ‘frappe’…
remote: Counting objects: 149853, done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 149853 (delta 15), reused 8 (delta 3), pack-reused 149801
Receiving objects: 100% (149853/149853), 162.66 MiB | 519.00 KiB/s, done.
Resolving deltas: 100% (113415/113415), done.
(‘installing’, u’frappe’)
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
Command “/home/frappe/bench-repo/frappe-bench/env/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-d1LttW/lxml/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-nxwY2o-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/bench-repo/frappe-bench/env/include/site/python2.7/lxml” failed with error code 1 in /tmp/pip-build-d1LttW/lxml/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/commands/make.py”, line 30, in init
python = python)
File “/home/frappe/bench-repo/bench/utils.py”, line 75, in init
get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
File “/home/frappe/bench-repo/bench/app.py”, line 135, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/home/frappe/bench-repo/bench/app.py”, line 179, in install_app
find_links=find_links))
File “/home/frappe/bench-repo/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
frappe@raspberrypi3:~/bench-repo $

LXML probably needs some native libs that might be missing in your distro.

Thank you for the reply.

Its very possible, i’ve followed these steps, Installing lxml and got it to work.

Thanks for the hint.